org.jnetstream.capture.file
Interface Files.Factory

Enclosing class:
Files

public static interface Files.Factory

Factory interface that actually does all the work.

Author:
Mark Bednarczyk, Sly Technologies, Inc.

Method Summary
 Packet newPacket(Protocol dlt, java.nio.ByteBuffer buffer)
          Create a new packet with user supplied buffer.
 Packet newPacket(Protocol dlt, int length)
          Creates a new packet with internally allocated buffer specified length.
 

Method Detail

newPacket

Packet newPacket(Protocol dlt,
                 int length)
Creates a new packet with internally allocated buffer specified length. The buffer can be retrieved using Packet.getBuffer() method call. The packet included length will be set to the length of the buffer. The buffer can be later resized but may invalidate any buffer references returned prior to the resize call.

Parameters:
length - length of the backing buffer for this packet
dlt - data-link-type, first protocol in the packet
Returns:
new packet

newPacket

Packet newPacket(Protocol dlt,
                 java.nio.ByteBuffer buffer)
Create a new packet with user supplied buffer. The supplied buffer properties position and limit determine the boundaries for the packet data.

Parameters:
buffer - user supplied buffer to hold the packet contents
dlt - data-link-type, first protocol in the packet
Returns:
new packet