@Test public void testWriteHeader() { FrameWriter framer = new FrameWriter(encoder, Integer.MAX_VALUE, (byte) 1, transport); byte[] header = new byte[] {0, 0, 0, 9, 3, 4, 0, 12}; framer.writeHeader(header); ByteBuffer headerBuffer = ByteBuffer.allocate(16); framer.readBytes(headerBuffer); assertEquals(FrameWriter.FRAME_HEADER_SIZE, headerBuffer.position()); headerBuffer.flip(); assertEquals(FrameWriter.FRAME_HEADER_SIZE + 1, headerBuffer.getInt()); assertEquals(3, headerBuffer.get()); assertEquals(4, headerBuffer.get()); assertEquals(12, headerBuffer.getShort()); }
void writeHeader(byte[] header) { frameBuffer.put(header, 0, header.length); }
FrameWriter { void writeHeader(byte[] header) { frameBuffer.put(header, 0, header.length); } }
FrameWriter { void writeHeader(byte[] header) { frameBuffer.put(header, 0, header.length); } FrameWriter(EncoderImpl encoder, int maxFrameSize, byte frameType, TransportImpl transport); }
FrameWriter { void writeHeader(byte[] header) { frameBuffer.put(header, 0, header.length); } FrameWriter(EncoderImpl encoder, int maxFrameSize, byte frameType, TransportImpl transport);  }
FrameWriter { void writeHeader(byte[] header) { frameBuffer.put(header, 0, header.length); } FrameWriter(EncoderImpl encoder, int maxFrameSize, byte frameType, TransportImpl transport);   }