All Known Implementing Classes:
FileBuffer, GzipFileBuffer, MemoryBuffer, OutputStreamBuffer, ReadBuffer

public interface Buffer
Base interface for data buffers. Data access is primarily through streams, with additional methods available in subclasses.
  • Method Summary

    All Methods
    Modifier and Type
    Method
    Description
    Get an InputStream for reading from this buffer.
    int
    Get the length of data in this buffer.
    int
    Get the offset into the underlying data.
    Get an OutputStream for writing to this buffer.
    void
    readComplete(boolean success)
    Top-level reader MUST call this to close the input stream.
    void
    writeComplete(boolean success)
    Writer MUST call this when done.
  • Method Details

    • getInputStream

      InputStream getInputStream() throws IOException
      Get an InputStream for reading from this buffer.
      Returns:
      InputStream for reading
      Throws:
      IOException - on I/O error
    • getOutputStream

      OutputStream getOutputStream() throws IOException
      Get an OutputStream for writing to this buffer.
      Returns:
      OutputStream for writing
      Throws:
      IOException - on I/O error
    • readComplete

      void readComplete(boolean success)
      Top-level reader MUST call this to close the input stream.
      Parameters:
      success - if false, the read is considered failed
    • writeComplete

      void writeComplete(boolean success)
      Writer MUST call this when done.
      Parameters:
      success - if false, deletes any resources
    • getLength

      int getLength()
      Get the length of data in this buffer.
      Returns:
      length in bytes
    • getOffset

      int getOffset()
      Get the offset into the underlying data.
      Returns:
      offset in bytes