PcapDumper implements Closeable { public void dump(Packet packet) throws NotOpenException { dump(packet, new Timestamp(System.currentTimeMillis())); } PcapDumper(Pointer dumper, TimestampPrecision timestampPrecision); boolean isOpen(); void dump(Packet packet); void dump(Packet packet, Timestamp timestamp); void dumpRaw(byte[] packet); void dumpRaw(byte[] packet, Timestamp timestamp); void flush(); long ftell(); @Override void close();  }
@Test public void testDump() throws Exception { dumper.dump(packet); dumper.flush(); assertTrue(dumpFile.exists()); assertTrue(dumpFile.length() >= packet.length()); }