Package edu.rit.pj.cluster
Class BackendFileInputStream
java.lang.Object
java.io.InputStream
edu.rit.pj.cluster.BackendFileInputStream
- All Implemented Interfaces:
Closeable,AutoCloseable
Class BackendFileInputStream provides an object in a job backend process that
reads a sequential file in the job frontend process. A backend file input
stream is not constructed directly, rather it is created by a factory method
in class BackendFileReader.
Note: Class BackendFileInputStream does not do any buffering. Each method call sends a message to and receives a message from the job frontend. Consider layering a BufferedInputStream on top of the BackendFileInputStream.
- Version:
- 20-Nov-2006
- Author:
- Alan Kaminsky
-
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Close this input stream.intread()Read a byte from this input stream.intread(byte[] buf) Read the given byte array from this input stream.intread(byte[] buf, int off, int len) Read a portion of the given byte array from this input stream.longskip(long len) Skip the given number of bytes from this input stream.Methods inherited from class java.io.InputStream
available, mark, markSupported, nullInputStream, readAllBytes, readNBytes, readNBytes, reset, skipNBytes, transferTo
-
Method Details
-
read
Read a byte from this input stream. The byte is returned as anintin the range 0 .. 255.- Specified by:
readin classInputStream- Returns:
- a int.
- Throws:
IOException- Thrown if an I/O error occurred.IOException- if any.
-
read
Read the given byte array from this input stream.- Overrides:
readin classInputStream- Parameters:
buf- Byte array.- Returns:
- Number of bytes actually read, or -1 if the end-of-stream was encountered.
- Throws:
NullPointerException- (unchecked exception) Thrown ifbufis null.IOException- Thrown if an I/O error occurred.IOException- if any.
-
read
Read a portion of the given byte array from this input stream.- Overrides:
readin classInputStream- Throws:
NullPointerException- (unchecked exception) Thrown ifbufis null.IndexOutOfBoundsException- (unchecked exception) Thrown ifoff< 0,len< 0, oroff+len>buf.length.IOException- Thrown if an I/O error occurred.
-
skip
Skip the given number of bytes from this input stream.- Overrides:
skipin classInputStream- Throws:
IOException- Thrown if an I/O error occurred.
-
close
Close this input stream.- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Overrides:
closein classInputStream- Throws:
IOException- Thrown if an I/O error occurred.IOException- if any.
-