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 TypeMethodDescriptionvoidclose()Closes this input stream and releases any system resources associated with the stream.booleanfinished()Finished.Gets the PTCP buffer.intread()Reads the next byte of data from the input stream.intread(byte[] b) Reads some number of bytes from the input stream and stores them into the buffer array b.intread(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:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Overrides:
closein 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:
readin 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:
readin 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:
readin classInputStream- Throws:
IOException
-
getPTCPBuffer
-