@Test public void decode () throws Exception { val bits = new byte[] { 1, 2, 3 }; val pad = 3; val bytes = Bytes.resizableArray() .write1B(BIT_BINNARY.getCode()) .write4B(bits.length) .write1B(8 - pad) .writeNB(new byte[] { 1, 2, 0 }) .arrayCopy(); try (val input = new OtpInputStream(bytes)) { ErlangBitString bitString = ErlangTerm.newInstance(wrappedBuffer(bytes)); assertThat(bitString.getBits()) .isEqualTo(input.read_bitstr(new int[1])); } }
public byte[] getBits () { return bits.clone(); }
ErlangBitString extends ErlangTerm { public byte[] getBits () { return bits.clone(); } }
ErlangBitString extends ErlangTerm { public byte[] getBits () { return bits.clone(); } ErlangBitString(TermType type, @NonNull ByteBuf buffer); @Builder  ErlangBitString(@NonNull byte[] bits, int pad); }
ErlangBitString extends ErlangTerm { public byte[] getBits () { return bits.clone(); } ErlangBitString(TermType type, @NonNull ByteBuf buffer); @Builder  ErlangBitString(@NonNull byte[] bits, int pad); byte[] getBits(); }
ErlangBitString extends ErlangTerm { public byte[] getBits () { return bits.clone(); } ErlangBitString(TermType type, @NonNull ByteBuf buffer); @Builder  ErlangBitString(@NonNull byte[] bits, int pad); byte[] getBits();  }