From acdbace5ea1f42f54b0d71d666155a53b08c09e2 Mon Sep 17 00:00:00 2001 From: Collin Smith Date: Sat, 8 Aug 2020 14:40:11 -0700 Subject: [PATCH] Deprecated and removed multi-byte read methods from BitInput Unaligned multi-byte read operations shouldn't align stream Implementing unaligned multi-byte read support is required --- core/src/com/riiablo/io/nio/BitInput.java | 33 ++++++++++++++--------- 1 file changed, 21 insertions(+), 12 deletions(-) diff --git a/core/src/com/riiablo/io/nio/BitInput.java b/core/src/com/riiablo/io/nio/BitInput.java index f6056c24..93482491 100644 --- a/core/src/com/riiablo/io/nio/BitInput.java +++ b/core/src/com/riiablo/io/nio/BitInput.java @@ -450,25 +450,34 @@ public class BitInput { } /** - * Aligns bit stream and reads from {@link #align()} + * @deprecated unaligned reads not supported! + * use {@code align().readBytes(int)} instead! + *
{@link #align()} {@link ByteInput#readBytes(int)}
*/ - public byte[] readBytes(int len) { - return align().readBytes(len); - } +// @Deprecated +// public byte[] readBytes(int len) { +// throw new UnsupportedOperationException("use align().readBytes(int) instead!"); +// } /** - * Aligns bit stream and reads from {@link #align()} + * @deprecated unaligned reads not supported! + * use {@code align().readBytes(byte[])} instead! + *
{@link #align()} {@link ByteInput#readBytes(byte[])}
*/ - public byte[] readBytes(byte[] dst) { - return align().readBytes(dst); - } +// @Deprecated +// public byte[] readBytes(byte[] dst) { +// throw new UnsupportedOperationException("use align().readBytes(byte[]) instead!"); +// } /** - * Aligns bit stream and reads from {@link #align()} + * @deprecated unaligned reads not supported! + * use {@code align().readBytes(byte[], int, int)} instead! + *
{@link #align()} {@link ByteInput#readBytes(byte[], int, int)}
*/ - public byte[] readBytes(byte[] dst, int dstOffset, int len) { - return align().readBytes(dst, dstOffset, len); - } +// @Deprecated +// public byte[] readBytes(byte[] dst, int dstOffset, int len) { +// throw new UnsupportedOperationException("use align().readBytes(byte[],int,int) instead!"); +// } /** * Reads n bytes from the bit stream and constructs a string.