Class ByteBuffer

java.lang.Object
com.portal.pcm.Buffer
com.portal.pcm.ByteBuffer

public class ByteBuffer extends Buffer
The ByteBuffer subclass of Buffer is used when the buffer information is to be handled as a byte array.
  • Constructor Details

    • ByteBuffer

      public ByteBuffer(byte[] bytes, int offset, boolean forRead)
      Creates an instance of a Buffer.
      Parameters:
      bytes - holds the bytes which will be processed
      offset - initial position in the buffer to read or write at
      forRead - boolean value indicating whether to read the file
    • ByteBuffer

      public ByteBuffer()
      Creates an instance of a Buffer.
  • Method Details

    • getBytes

      public byte[] getBytes()
      Gets the buffer.
      Returns:
      The buffer as a byte array.
    • setBytes

      public void setBytes(byte[] bytes)
      Sets the buffer.
      Parameters:
      bytes - The new buffer.
    • getSize

      public long getSize()
      Gets the buffer size.
      Specified by:
      getSize in class Buffer
      Returns:
      The buffer size.
    • getInputStream

      public InputStream getInputStream() throws IOException
      Gets an InputStream to read buffer information.
      Specified by:
      getInputStream in class Buffer
      Returns:
      An InputStream object.
      Throws:
      IOException - This exception may be thrown if there is an issue with the underlying I/O operations
    • getOutputStream

      public OutputStream getOutputStream() throws IOException
      Gets an OutputStream to write buffer information.
      Specified by:
      getOutputStream in class Buffer
      Returns:
      An OutputStream object.
      Throws:
      IOException - This exception may be thrown if there is an issue with the underlying I/O operations