Class ArrayOutputStream

java.lang.Object
java.io.OutputStream
org.apache.derby.iapi.services.io.ArrayOutputStream
All Implemented Interfaces:
Closeable, Flushable, AutoCloseable, Limit

public class ArrayOutputStream extends OutputStream implements Limit
  • Field Details

    • pageData

      private byte[] pageData
    • start

      private int start
    • end

      private int end
    • position

      private int position
  • Constructor Details

    • ArrayOutputStream

      public ArrayOutputStream()
    • ArrayOutputStream

      public ArrayOutputStream(byte[] data)
  • Method Details

    • setData

      public void setData(byte[] data)
    • write

      public void write(int b) throws IOException
      Specified by:
      write in class OutputStream
      Throws:
      IOException
    • write

      public void write(byte[] b, int off, int len) throws IOException
      Overrides:
      write in class OutputStream
      Throws:
      IOException
    • getPosition

      public int getPosition()
    • setPosition

      public void setPosition(int newPosition) throws IOException
      Set the position of the stream pointer.
      Throws:
      IOException
    • setLimit

      public void setLimit(int length) throws IOException
      Description copied from interface: Limit
      Set the limit of the data that can be read or written. After this call up to and including length bytes can be read from or skipped in the stream.

      On input classes (e.g. InputStreams) any attempt to read or skip beyond the limit will result in an end of file indication (e.g. read() methods returning -1 or throwing EOFException).

      On output classes (e.g. OutputStream) any attempt to write more beyond the limit will result in an EOFException

      Specified by:
      setLimit in interface Limit
      Throws:
      IOException - IOException from some underlying stream
    • clearLimit

      public int clearLimit()
      Description copied from interface: Limit
      Clear any limit set by setLimit. After this call no limit checking will be made on any read until a setLimit()) call is made.
      Specified by:
      clearLimit in interface Limit
      Returns:
      the number of bytes within the limit that have not been read or written.