org.jnetstream.capture.file
Class Files

java.lang.Object
  extended by org.jnetstream.capture.file.Files

public class Files
extends java.lang.Object

Factory methods for working with the jNetStream packet package and individual packets.

Author:
Mark Bednarczyk, Sly Technologies, Inc.

Nested Class Summary
static interface Files.Factory
          Factory interface that actually does all the work.
 
Method Summary
static Files.Factory getLocal()
           
static Packet newPacket(Protocol dlt, java.nio.ByteBuffer buffer)
          Create a new packet with user supplied buffer.
static Packet newPacket(Protocol dlt, int length)
          Creates a new packet with internally allocated buffer specified length.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getLocal

public static Files.Factory getLocal()

newPacket

public static 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

public static 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 empty packet