Class PTCPInputStream

java.lang.Object
java.io.InputStream
ecmwf.common.transport.ptcp.psocket.PTCPInputStream
All Implemented Interfaces:
Closeable, AutoCloseable

public class PTCPInputStream extends InputStream
The Class PTCPInputStream.
  • Constructor Details

    • PTCPInputStream

      public PTCPInputStream(InputStream[] streams) throws IOException
      Default constructor Construct an empty parallel input stream with performance increase option.
      Parameters:
      streams - the streams
      Throws:
      IOException - Signals that an I/O exception has occurred.
  • Method Details

    • close

      public void close() throws IOException
      Closes this input stream and releases any system resources associated with the stream.
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface Closeable
      Overrides:
      close in class InputStream
      Throws:
      IOException
    • finished

      public boolean finished()
      Finished.
      Returns:
      true, if successful
    • 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
      Throws:
      IOException
    • getPTCPBuffer

      public PTCPBuffer getPTCPBuffer()
      Gets the PTCP buffer.
      Returns:
      the PTCP buffer