Class PTCPInputStream
java.lang.Object
java.io.InputStream
ecmwf.common.transport.ptcp.psocket.PTCPInputStream
-
Constructor Summary
ConstructorsConstructorDescriptionPTCPInputStream
(InputStream[] streams) Default constructor Construct an empty parallel input stream with performance increase option. -
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
Closes this input stream and releases any system resources associated with the stream.boolean
finished()
Finished.Gets the PTCP buffer.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.Methods inherited from class java.io.InputStream
available, mark, markSupported, nullInputStream, readAllBytes, readNBytes, readNBytes, reset, skip, skipNBytes, transferTo
-
Constructor Details
-
PTCPInputStream
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
Closes this input stream and releases any system resources associated with the stream.- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Overrides:
close
in classInputStream
- Throws:
IOException
-
finished
public boolean finished()Finished.- Returns:
- true, if successful
-
read
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 classInputStream
- Throws:
IOException
-
read
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 classInputStream
- Throws:
IOException
-
read
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 classInputStream
- Throws:
IOException
-
getPTCPBuffer
-