JBBPOut extends AbstractMappedClassFieldObserver { public JBBPOut Skip(int numberOfBytes) throws IOException { assertNotEnded(); if (this.processCommands) { if (numberOfBytes < 0) { throw new IllegalArgumentException("Value is negative"); } this.Align(); while (numberOfBytes > 0) { this.outStream.write(0); numberOfBytes--; } } return this; } private  JBBPOut(final OutputStream outStream, final JBBPByteOrder byteOrder, final JBBPBitOrder bitOrder); static JBBPOut BeginBin(final JBBPByteOrder byteOrder, final JBBPBitOrder bitOrder); static JBBPOut BeginBin(final OutputStream out, final JBBPByteOrder byteOrder, final JBBPBitOrder bitOrder); static JBBPOut BeginBin(); static JBBPOut BeginBin(final int initialSize); static JBBPOut BeginBin(final OutputStream out); static JBBPOut BeginBin(final JBBPByteOrder byteOrder); static JBBPOut BeginBin(final JBBPBitOrder bitOrder); JBBPOut Align(); JBBPOut Align(final int value); JBBPOut Skip(int numberOfBytes); JBBPOut ByteOrder(final JBBPByteOrder value); JBBPOut Bit(final boolean value); JBBPOut Bit(final byte value); JBBPOut Bit(final byte[] value); JBBPOut Bit(final int... value); JBBPOut Bit(final boolean... value); JBBPOut Bits(final JBBPBitNumber numberOfBits, final int value); JBBPOut Bits(final JBBPBitNumber numberOfBits, final int... value); JBBPOut Bits(final JBBPBitNumber numberOfBits, final byte[] value); JBBPOut Byte(final int value); JBBPOut Byte(final int... value); JBBPOut Byte(final byte[] value); JBBPOut Byte(final String str); JBBPOut Byte(final String str, final JBBPBitOrder bitOrder); JBBPOut Utf8(final String str); JBBPOut String(String str); JBBPOut Strings(final String... strings); JBBPOut Bool(final boolean value); JBBPOut Bool(final boolean value, final JBBPBitOrder bitOrder); JBBPOut Bool(final boolean... value); JBBPOut Short(final int value); JBBPOut Short(final String str); JBBPOut Short(final String str, final JBBPBitOrder bitOrder); JBBPOut Short(final short[] value); JBBPOut Short(final char[] value); JBBPOut Short(final int... value); JBBPOut Int(final int value); JBBPOut Int(final int... value); JBBPOut Float(final float... value); JBBPOut Long(final long value); JBBPOut Double(final double... value); JBBPOut ResetCounter(); JBBPOut Long(final long... value); JBBPOut Var(final JBBPOutVarProcessor processor, final Object... args); JBBPOut Flush(); ByteArrayOutputStream End(); long getByteCounter(); JBBPOut Bin(final Object object); JBBPOut Bin(final Object object, final JBBPCustomFieldWriter customFieldWriter); JBBPOut Bin(final Object object, final BinAnnotationWrapper binAnnotationWrapper, final JBBPCustomFieldWriter customFieldWriter); JBBPOut BinForceByteOrder(final Object object); JBBPOut BinForceByteOrder(final Object object, final JBBPCustomFieldWriter customFieldWriter); static final JBBPByteOrder DEFAULT_BYTE_ORDER; static final JBBPBitOrder DEFAULT_BIT_ORDER; }
@Test public void testSkip() throws Exception { assertArrayEquals(new byte[] {(byte) 0x01, (byte) 0xFF}, BeginBin().Bit(1).Skip(0).Byte(0xFF).End().toByteArray()); assertArrayEquals(new byte[] {(byte) 0x01, 0x00, (byte) 0xFF}, BeginBin().Bit(1).Skip(1).Byte(0xFF).End().toByteArray()); assertArrayEquals(new byte[] {(byte) 0x01, 0x00, 0x00, (byte) 0xFF}, BeginBin().Bit(1).Skip(2).Byte(0xFF).End().toByteArray()); }