cgl.narada.transport.ptcp.psocket
Class PTCPInputStream

java.lang.Object
  extended by java.io.InputStream
      extended by cgl.narada.transport.ptcp.psocket.PTCPInputStream
All Implemented Interfaces:
PTCPParameters, Closeable

public class PTCPInputStream
extends InputStream
implements PTCPParameters


Field Summary
 PTCPBuffer buffer_
           
 
Fields inherited from interface cgl.narada.transport.ptcp.psocket.tools.PTCPParameters
COMM_SOCKET, DATA_SOCKET, PTCPBuffer_Debug, PTCPDataFragmentator_Debug, PTCPInputStream_Debug, PTCPOutputStream_Debug, PTCPPacket_Debug, PTCPReceiverWorker_Debug, PTCPSenderWorker_Debug, PTCPServerSocket_Debug, PTCPSocket_Debug, PTCPSocketInfo_Debug
 
Constructor Summary
PTCPInputStream(InputStream[] streams)
          Default constructor Construct an empty parallel input stream.
PTCPInputStream(InputStream[] streams, boolean incPrf)
          Default constructor Construct an empty parallel input stream with performance increase option
 
Method Summary
 void close()
          Closes this input stream and releases any system resources associated with the stream.
 boolean finished()
           
 int getPacketSize()
           
 long getTxEndTime()
           
 int read()
          Reads the next byte of data from the input stream.
 int read(byte[] b)
          Reads some number of bytes from the input stream and stores them into the buffer array b.
 int read(byte[] b, int off, int length)
          Reads up to len bytes of data from the input stream into an array of bytes.
 byte[] receive()
           
 void setTxEndTime(long txEndTime)
           
 
Methods inherited from class java.io.InputStream
available, mark, markSupported, reset, skip
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

buffer_

public PTCPBuffer buffer_
Constructor Detail

PTCPInputStream

public PTCPInputStream(InputStream[] streams)
Default constructor Construct an empty parallel input stream.


PTCPInputStream

public PTCPInputStream(InputStream[] streams,
                       boolean incPrf)
Default constructor Construct an empty parallel input stream with performance increase option

Method Detail

setTxEndTime

public void setTxEndTime(long txEndTime)

getTxEndTime

public long getTxEndTime()

close

public void close()
           throws IOException
Closes this input stream and releases any system resources associated with the stream.

Specified by:
close in interface Closeable
Overrides:
close in class InputStream
Throws:
IOException

finished

public boolean finished()

read

public int read()
         throws IOException
Reads the next byte of data from the input stream. The value byte is returned as an int in the range 0 to 255. If no byte is available because the end of the stream has been reached, the value -1 is returned. This method blocks until input data is available, the end of thestream is detected, or an exception is thrown. This read only works if the input stream on the other end sends out one byte of data, otherwise IOException will be thrown. Returns: the next byte of data, or -1 if the end of the stream is reached.

Specified by:
read in class InputStream
Throws:
IOException

read

public int read(byte[] b)
         throws IOException
Reads some number of bytes from the input stream and stores them into the buffer array b. The number of bytes actually read is returned as an integer. This method blocks until input data is available, end of file is detected, or an exception is thrown. If size of b is less than data size from input stream, an IOException will be thrown.

Overrides:
read in class InputStream
Throws:
IOException

read

public int read(byte[] b,
                int off,
                int length)
         throws IOException
Reads up to len bytes of data from the input stream into an array of bytes. An attempt is made to read as many as len bytes, but a smaller number may be read, possibly zero. The number of bytes actually read is returned as an integer. This method blocks until input data is available, end of file is detected, or an exception is thrown. The parameter len must be larger than the size of data being sent over, or an IOException is thrown.

Overrides:
read in class InputStream
Parameters:
b - - the data.
off - - the start offset in the data.
length - - the maximum number of bytes to read.
Throws:
IOException

receive

public byte[] receive()
               throws InterruptedException
Throws:
InterruptedException

getPacketSize

public int getPacketSize()


For comments and suggestions please send e-mail to The NaradaBrokering Project