Class AbstractFileIO

    • Constructor Detail

      • AbstractFileIO

        public AbstractFileIO()
    • Method Detail

      • readFully

        public int readFully​(ByteBuffer destBuf)
                      throws IOException
        Reads a sequence of bytes from this file into the destinationBuffer.
        Specified by:
        readFully in interface FileIO
        Parameters:
        destBuf - Destination byte buffer.
        Returns:
        Number of written bytes.
        Throws:
        IOException - If some I/O error occurs.
      • readFully

        public int readFully​(ByteBuffer destBuf,
                             long position)
                      throws IOException
        Reads a sequence of bytes from this file into the destinationBuffer starting from specified file position.
        Specified by:
        readFully in interface FileIO
        Parameters:
        destBuf - Destination byte buffer.
        position - Starting position of file.
        Returns:
        Number of written bytes.
        Throws:
        IOException - If some I/O error occurs.
      • readFully

        public int readFully​(byte[] buf,
                             int off,
                             int len)
                      throws IOException
        Reads a up to length bytes from this file into the buffer.
        Specified by:
        readFully in interface FileIO
        Parameters:
        buf - Destination byte array.
        off - The start offset in array b at which the data is written.
        len - Number of bytes read.
        Returns:
        Number of written bytes.
        Throws:
        IOException - If some I/O error occurs.
      • writeFully

        public int writeFully​(ByteBuffer srcBuf)
                       throws IOException
        Writes a sequence of bytes to this file from the sourceBuffer.
        Specified by:
        writeFully in interface FileIO
        Parameters:
        srcBuf - Source buffer.
        Returns:
        Number of written bytes.
        Throws:
        IOException - If some I/O error occurs.
      • writeFully

        public int writeFully​(ByteBuffer srcBuf,
                              long position)
                       throws IOException
        Writes a sequence of bytes to this file from the sourceBuffer starting from specified file position
        Specified by:
        writeFully in interface FileIO
        Parameters:
        srcBuf - Source buffer.
        position - Starting file position.
        Returns:
        Number of written bytes.
        Throws:
        IOException - If some I/O error occurs.
      • writeFully

        public int writeFully​(byte[] buf,
                              int off,
                              int len)
                       throws IOException
        Writes length bytes from the buffer starting at offset off to this file.
        Specified by:
        writeFully in interface FileIO
        Parameters:
        buf - Source byte array.
        off - Start offset in the buffer.
        len - Number of bytes to write.
        Returns:
        Number of written bytes.
        Throws:
        IOException - If some I/O error occurs.