PcapFramer implements Framer<Packet, PCapPacket> { public PcapFramer(final PcapGlobalHeader globalHeader, final FramerManager framerManager) { assert globalHeader != null; assert framerManager != null; this.globalHeader = globalHeader; this.byteOrder = this.globalHeader.getByteOrder(); this.framerManager = framerManager; } PcapFramer(final PcapGlobalHeader globalHeader, final FramerManager framerManager); @Override Protocol getProtocol(); @Override PCapPacket frame(final Packet parent, final Buffer buffer); @Override boolean accept(final Buffer data);  }
@Test public void testPcapFramer() throws Exception { verifyNextFrame(this.pcapStream, 348); verifyNextFrame(this.pcapStream, 507); verifyNextFrame(this.pcapStream, 398); verifyNextFrame(this.pcapStream, 547); verifyNextFrame(this.pcapStream, 348); PCapPacket frame = null; for (int i = 6; i < 30; ++i) { frame = this.framer.frame(null, this.pcapStream); assertNotNull(frame); } assertThat(340, is(frame.getPayload().capacity())); frame = this.framer.frame(null, this.pcapStream); assertThat(frame, is((PCapPacket) null)); }