test_class.declarator: out
test_class.modifier: @Mock
      private
test_class.original_string: @Mock
      private OutputStream out;
test_class.type: OutputStream
test_class.var_name: out
test_class.file: preon-io/src/test/java/org/codehaus/preon/channel/OutputStreamBitChannelTest.java
test_class.identifier: OutputStreamBitChannelTest
test_case.body: @Test
      public void shouldDealWithNonAlignedBytes() throws IOException {
          OutputStreamBitChannel channel = new OutputStreamBitChannel(out);
          channel.write(3, (byte) 0xff); // 111
          channel.write(7, (byte) 0x00); // 0000000
          verify(out).write((byte) Integer.parseInt("11100000", 2));
          verifyNoMoreInteractions(out);
      }
test_case.class_method_signature: OutputStreamBitChannelTest.shouldDealWithNonAlignedBytes()
test_case.full_signature: @Test public void shouldDealWithNonAlignedBytes()
test_case.identifier: shouldDealWithNonAlignedBytes
test_case.invocations: write write write verify parseInt verifyNoMoreInteractions
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void shouldDealWithNonAlignedBytes()
focal_class.declarator: MASK_UPPER = new byte[]{
              (byte) Integer.parseInt("00000000", 2),
              (byte) Integer.parseInt("00000001", 2),
              (byte) Integer.parseInt("00000011", 2),
              (byte) Integer.parseInt("00000111", 2),
              (byte) Integer.parseInt("00001111", 2),
              (byte) Integer.parseInt("00011111", 2),
              (byte) Integer.parseInt("00111111", 2),
              (byte) Integer.parseInt("01111111", 2),
              (byte) Integer.parseInt("11111111", 2)}
focal_class.modifier: private static final
focal_class.original_string: private static final byte[] MASK_UPPER = new byte[]{
              (byte) Integer.parseInt("00000000", 2),
              (byte) Integer.parseInt("00000001", 2),
              (byte) Integer.parseInt("00000011", 2),
              (byte) Integer.parseInt("00000111", 2),
              (byte) Integer.parseInt("00001111", 2),
              (byte) Integer.parseInt("00011111", 2),
              (byte) Integer.parseInt("00111111", 2),
              (byte) Integer.parseInt("01111111", 2),
              (byte) Integer.parseInt("11111111", 2)};
focal_class.type: byte[]
focal_class.var_name: MASK_UPPER
focal_class.declarator: out
focal_class.modifier: private final
focal_class.original_string: private final OutputStream out;
focal_class.type: OutputStream
focal_class.var_name: out
focal_class.declarator: bitPos
focal_class.modifier: private
focal_class.original_string: private int bitPos;
focal_class.type: int
focal_class.var_name: bitPos
focal_class.declarator: buffer
focal_class.modifier: private
focal_class.original_string: private byte buffer;
focal_class.type: byte
focal_class.var_name: buffer
focal_class.file: preon-io/src/main/java/org/codehaus/preon/channel/OutputStreamBitChannel.java
focal_class.identifier: OutputStreamBitChannel
focal_class.interfaces: implements BitChannel, Closeable
focal_class.class_method_signature: OutputStreamBitChannel.OutputStreamBitChannel(@Nonnull OutputStream out)
focal_class.full_signature: public  OutputStreamBitChannel(@Nonnull OutputStream out)
focal_class.identifier: OutputStreamBitChannel
focal_class.modifiers: public
focal_class.parameters: (@Nonnull OutputStream out)
focal_class.signature:  OutputStreamBitChannel(@Nonnull OutputStream out)
focal_class.class_method_signature: OutputStreamBitChannel.write(boolean value)
focal_class.full_signature: public void write(boolean value)
focal_class.identifier: write
focal_class.modifiers: public
focal_class.parameters: (boolean value)
focal_class.return: void
focal_class.signature: void write(boolean value)
focal_class.class_method_signature: OutputStreamBitChannel.write(@Nonnegative int nrbits, byte value)
focal_class.full_signature: public void write(@Nonnegative int nrbits, byte value)
focal_class.identifier: write
focal_class.modifiers: public
focal_class.parameters: (@Nonnegative int nrbits, byte value)
focal_class.return: void
focal_class.signature: void write(@Nonnegative int nrbits, byte value)
focal_class.class_method_signature: OutputStreamBitChannel.write(@Nonnegative int nrbits, int value, ByteOrder byteOrder)
focal_class.full_signature: public void write(@Nonnegative int nrbits, int value, ByteOrder byteOrder)
focal_class.identifier: write
focal_class.modifiers: public
focal_class.parameters: (@Nonnegative int nrbits, int value, ByteOrder byteOrder)
focal_class.return: void
focal_class.signature: void write(@Nonnegative int nrbits, int value, ByteOrder byteOrder)
focal_class.class_method_signature: OutputStreamBitChannel.write(@Nonnegative int nrbits, long value, ByteOrder byteOrder)
focal_class.full_signature: public void write(@Nonnegative int nrbits, long value, ByteOrder byteOrder)
focal_class.identifier: write
focal_class.modifiers: public
focal_class.parameters: (@Nonnegative int nrbits, long value, ByteOrder byteOrder)
focal_class.return: void
focal_class.signature: void write(@Nonnegative int nrbits, long value, ByteOrder byteOrder)
focal_class.class_method_signature: OutputStreamBitChannel.write(@Nonnegative int nrbits, short value, ByteOrder byteOrder)
focal_class.full_signature: public void write(@Nonnegative int nrbits, short value, ByteOrder byteOrder)
focal_class.identifier: write
focal_class.modifiers: public
focal_class.parameters: (@Nonnegative int nrbits, short value, ByteOrder byteOrder)
focal_class.return: void
focal_class.signature: void write(@Nonnegative int nrbits, short value, ByteOrder byteOrder)
focal_class.class_method_signature: OutputStreamBitChannel.write(@Nonnull byte[] src, int offset, int length)
focal_class.full_signature: public void write(@Nonnull byte[] src, int offset, int length)
focal_class.identifier: write
focal_class.modifiers: public
focal_class.parameters: (@Nonnull byte[] src, int offset, int length)
focal_class.return: void
focal_class.signature: void write(@Nonnull byte[] src, int offset, int length)
focal_class.class_method_signature: OutputStreamBitChannel.write(@Nonnull ByteBuffer buffer)
focal_class.full_signature: public long write(@Nonnull ByteBuffer buffer)
focal_class.identifier: write
focal_class.modifiers: public
focal_class.parameters: (@Nonnull ByteBuffer buffer)
focal_class.return: long
focal_class.signature: long write(@Nonnull ByteBuffer buffer)
focal_class.class_method_signature: OutputStreamBitChannel.getRelativeBitPos()
focal_class.full_signature: public @Nonnegative int getRelativeBitPos()
focal_class.identifier: getRelativeBitPos
focal_class.modifiers: public @Nonnegative
focal_class.parameters: ()
focal_class.return: int
focal_class.signature: int getRelativeBitPos()
focal_class.class_method_signature: OutputStreamBitChannel.close()
focal_class.full_signature: public void close()
focal_class.identifier: close
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void close()
focal_method.body: public void write(boolean value) throws IOException {
          if (value) {
              buffer = (byte) (0xff & ((buffer << 1) | 0x01));
          } else {
              buffer = (byte) (0xff & (buffer << 1));
          }
          if (++bitPos == 8) {
              bitPos = 0;
              out.write(buffer);
              buffer = 0;
          }
      }
focal_method.class_method_signature: OutputStreamBitChannel.write(boolean value)
focal_method.full_signature: public void write(boolean value)
focal_method.identifier: write
focal_method.invocations: write
focal_method.modifiers: public
focal_method.parameters: (boolean value)
focal_method.return: void
focal_method.signature: void write(boolean value)