Documentation of 'edu.rit.pj.cluster.BackendFileInputStream' Java class
BackendFileInputStream
edu.rit.pj.cluster

Class BackendFileInputStream

  • All Implemented Interfaces:
    java.io.Closeable, java.lang.AutoCloseable


    public class BackendFileInputStream
    extends java.io.InputStream
    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.

    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      void close()
      Close this input stream.
      int read()
      Read a byte from this input stream.
      int read(byte[] buf)
      Read the given byte array from this input stream.
      int read(byte[] buf, int off, int len)
      Read a portion of the given byte array from this input stream.
      long skip(long len)
      Skip the given number of bytes from this input stream.
      • Methods inherited from class java.io.InputStream

        available, mark, markSupported, reset
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • read

        public int read()
                 throws java.io.IOException
        Read a byte from this input stream. The byte is returned as an int in the range 0 .. 255.
        Specified by:
        read in class java.io.InputStream
        Returns:
        Byte, or -1 if the end-of-stream was encountered.
        Throws:
        java.io.IOException - Thrown if an I/O error occurred.
      • read

        public int read(byte[] buf)
                 throws java.io.IOException
        Read the given byte array from this input stream.
        Overrides:
        read in class java.io.InputStream
        Parameters:
        buf - Byte array.
        Returns:
        Number of bytes actually read, or -1 if the end-of-stream was encountered.
        Throws:
        java.lang.NullPointerException - (unchecked exception) Thrown if buf is null.
        java.io.IOException - Thrown if an I/O error occurred.
      • read

        public int read(byte[] buf,
                        int off,
                        int len)
                 throws java.io.IOException
        Read a portion of the given byte array from this input stream.
        Overrides:
        read in class java.io.InputStream
        Parameters:
        buf - Byte array.
        off - Index of first byte to read.
        len - Number of bytes to read.
        Returns:
        Number of bytes actually read, or -1 if the end-of-stream was encountered.
        Throws:
        java.lang.NullPointerException - (unchecked exception) Thrown if buf is null.
        java.lang.IndexOutOfBoundsException - (unchecked exception) Thrown if off < 0, len < 0, or off+len > buf.length.
        java.io.IOException - Thrown if an I/O error occurred.
      • skip

        public long skip(long len)
                  throws java.io.IOException
        Skip the given number of bytes from this input stream.
        Overrides:
        skip in class java.io.InputStream
        Parameters:
        len - Number of bytes to skip.
        Returns:
        Number of bytes actually skipped.
        Throws:
        java.io.IOException - Thrown if an I/O error occurred.
      • close

        public void close()
                   throws java.io.IOException
        Close this input stream.
        Specified by:
        close in interface java.io.Closeable
        Specified by:
        close in interface java.lang.AutoCloseable
        Overrides:
        close in class java.io.InputStream
        Throws:
        java.io.IOException - Thrown if an I/O error occurred.

DMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.