Skip to content

Commit 4ef685f

Browse files
committed
substream(): add missing call to alignToByte()
See kaitai-io/kaitai_struct#1282 Fixes the BitsByteAligned for Java - see kaitai-io/kaitai_struct_tests@f726641
1 parent a31e1d9 commit 4ef685f

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

src/main/java/io/kaitai/struct/ByteBufferKaitaiStream.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -468,6 +468,7 @@ public byte[] readBytesTermMulti(byte[] term, boolean includeTerm, boolean consu
468468

469469
@Override
470470
public KaitaiStream substream(long n) {
471+
alignToByte();
471472
if (n > Integer.MAX_VALUE) {
472473
throw new IllegalArgumentException("Java ByteBuffer can't be limited beyond Integer.MAX_VALUE");
473474
}

0 commit comments

Comments
 (0)