Class UnsyncByteArrayOutputStream

java.lang.Object
java.io.OutputStream
org.apache.xml.security.utils.UnsyncByteArrayOutputStream
All Implemented Interfaces:
Closeable, Flushable, AutoCloseable

public class UnsyncByteArrayOutputStream extends OutputStream
A simple Unsynced ByteArrayOutputStream
  • Field Details

    • VM_ARRAY_INDEX_MAX_VALUE

      private static final int VM_ARRAY_INDEX_MAX_VALUE
      See Also:
    • INITIAL_SIZE

      private static final int INITIAL_SIZE
      See Also:
    • buf

      private byte[] buf
    • size

      private int size
    • pos

      private int pos
  • Constructor Details

    • UnsyncByteArrayOutputStream

      public UnsyncByteArrayOutputStream()
  • Method Details

    • write

      public void write(byte[] arg0)
      Overrides:
      write in class OutputStream
    • write

      public void write(byte[] arg0, int arg1, int arg2)
      Overrides:
      write in class OutputStream
    • write

      public void write(int arg0)
      Specified by:
      write in class OutputStream
    • toByteArray

      public byte[] toByteArray()
    • reset

      public void reset()
    • writeTo

      public void writeTo(OutputStream out) throws IOException
      Takes the contents of this stream and writes it to the output stream out.
      Parameters:
      out - an OutputStream on which to write the contents of this stream.
      Throws:
      IOException - if an error occurs while writing to out.
    • expandSize

      private void expandSize(int newPos)