com.act365.net.tcp
Class TCPReader

java.lang.Object
  |
  +--com.act365.net.tcp.TCPReader

public class TCPReader
extends java.lang.Object

Reads TCP messages.


Constructor Summary
TCPReader()
           
 
Method Summary
static TCPMessage read(byte[] buffer, int offset, int count)
          Reads a TCP message from a buffer without a checksum test.
static TCPMessage read(byte[] buffer, int offset, int count, boolean testchecksum, byte[] source, byte[] destination)
          Reads a TCP message from a buffer and performs a checksum test
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TCPReader

public TCPReader()
Method Detail

read

public static TCPMessage read(byte[] buffer,
                              int offset,
                              int count)
                       throws java.io.IOException
Reads a TCP message from a buffer without a checksum test.

read

public static TCPMessage read(byte[] buffer,
                              int offset,
                              int count,
                              boolean testchecksum,
                              byte[] source,
                              byte[] destination)
                       throws java.io.IOException
Reads a TCP message from a buffer and performs a checksum test
Parameters:
buffer - buffer to be read from
offset - position within buffer to read from
count - number of bytes to read
testchecksum - whether to test the checksum in the message
source - message source (used in checksum test)
destination - message destination (used in checksum test)
Returns:
the decoded message
Throws:
java.io.IOException - checksum error