HOME

com.ireasoning.core.network
Class TransportData

java.lang.Object
  extended bycom.ireasoning.core.network.TransportData
All Implemented Interfaces:
Serializable

public class TransportData
extends Object
implements Serializable

This class is a data structure representing a byte array and its valid length

See Also:
Serialized Form

Field Summary
protected  byte[] _data
          Data of this object
protected  int _length
          Valid length of this object's data
static int DEFAULT_BUF_SIZE
          Default buffer size is 16kb
 
Constructor Summary
TransportData()
          Default constructor.
TransportData(byte[] data)
          Constructor.
TransportData(byte[] data, int len)
          Constructor.
TransportData(int bufSize)
          Constructor.
TransportData(String s)
          Constructor.
 
Method Summary
 byte[] getData()
          Returns the data buffer
 InetAddress getIpAddress()
           
 int getLength()
          Returns the valid length of internal data buffer
 void setData(byte[] data)
          Sets a new byte array
 void setIpAddress(InetAddress ipAddress)
           
 void setLength(int len)
          Sets the valid length of interal data buffer
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_data

protected byte[] _data
Data of this object


_length

protected int _length
Valid length of this object's data


DEFAULT_BUF_SIZE

public static final int DEFAULT_BUF_SIZE
Default buffer size is 16kb

See Also:
Constant Field Values
Constructor Detail

TransportData

public TransportData()
Default constructor. Create a buffer with DEFAULT_BUF_SIZE


TransportData

public TransportData(int bufSize)
Constructor. Create a buffer with bufSize

Parameters:
bufSize - the buffer size of internal byte array object.

TransportData

public TransportData(byte[] data,
                     int len)
Constructor. Create a buffer which copies the passed data byte array

Parameters:
len - the buffer size of passed data object.
data - the data buffer

TransportData

public TransportData(byte[] data)
Constructor. Create a buffer which copies the passed data byte array

Parameters:
data - the data buffer

TransportData

public TransportData(String s)
Constructor. Create a buffer which copies the passed String object

Parameters:
s - a String object to be copied
Method Detail

setLength

public void setLength(int len)
Sets the valid length of interal data buffer


getLength

public int getLength()
Returns the valid length of internal data buffer


setData

public void setData(byte[] data)
Sets a new byte array


getData

public byte[] getData()
Returns the data buffer


getIpAddress

public InetAddress getIpAddress()

setIpAddress

public void setIpAddress(InetAddress ipAddress)

HOME

Copyright © 2002 iReasoning Inc. All Rights Reserved.