hu.netmind.ogg
Class Packet

java.lang.Object
  extended by hu.netmind.ogg.Packet
All Implemented Interfaces:
java.io.Serializable

public class Packet
extends java.lang.Object
implements java.io.Serializable

This class encapsulates all data for a given packet.

See Also:
Serialized Form

Field Summary
protected  boolean complete
           
protected  byte[] data
           
protected  int length
           
protected  int offset
           
protected  long position
           
 
Constructor Summary
Packet(byte[] data, int offset, int length, long position, boolean complete)
          Construct with all data given.
Packet(byte[] data, long position)
          Construct with all data given.
Packet(byte[] data, long position, boolean complete)
          Construct with all data given.
 
Method Summary
 byte[] getData()
           
 int getLength()
           
 int getOffset()
           
 long getPosition()
           
 boolean isComplete()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

data

protected byte[] data

offset

protected int offset

length

protected int length

position

protected long position

complete

protected boolean complete
Constructor Detail

Packet

public Packet(byte[] data,
              long position)
Construct with all data given.

Parameters:
data - The data of packet.
position - The granule position of logical stream after this packet. This may be -1 to indicate increment previous position.

Packet

public Packet(byte[] data,
              long position,
              boolean complete)
Construct with all data given.

Parameters:
data - The data of packet.
position - The granule position of logical stream after this packet. This may be -1 to indicate increment previous position.
complete - The complete flag indicates, that this packet is only a chunk.

Packet

public Packet(byte[] data,
              int offset,
              int length,
              long position,
              boolean complete)
Construct with all data given.

Parameters:
data - The data of packet.
offset - The offset into data.
length - The length of packet.
position - The granule position of logical stream after this packet. This may be -1 to indicate increment previous position.
complete - The complete flag indicates, that this packet is only a chunk.
Method Detail

getData

public byte[] getData()

getPosition

public long getPosition()

isComplete

public boolean isComplete()

getOffset

public int getOffset()

getLength

public int getLength()