Class SecureByteArrayOutputStream

  • All Implemented Interfaces:
    java.io.Closeable, java.io.Flushable, java.lang.AutoCloseable

    public final class SecureByteArrayOutputStream
    extends java.io.ByteArrayOutputStream
    A ByteArrayOutputStream that clears its internal buffer after resizing and when it is closed.
    • Field Summary

      • Fields inherited from class java.io.ByteArrayOutputStream

        buf, count
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void close()  
      void write​(byte[] b, int off, int len)  
      void write​(int b)  
      • Methods inherited from class java.io.ByteArrayOutputStream

        reset, size, toByteArray, toString, toString, toString, toString, writeBytes, writeTo
      • Methods inherited from class java.io.OutputStream

        flush, nullOutputStream, write
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • SecureByteArrayOutputStream

        public SecureByteArrayOutputStream()
      • SecureByteArrayOutputStream

        public SecureByteArrayOutputStream​(int initialSize)
    • Method Detail

      • close

        public void close()
        Specified by:
        close in interface java.lang.AutoCloseable
        Specified by:
        close in interface java.io.Closeable
        Overrides:
        close in class java.io.ByteArrayOutputStream
      • write

        public void write​(int b)
        Overrides:
        write in class java.io.ByteArrayOutputStream
      • write

        public void write​(byte[] b,
                          int off,
                          int len)
        Overrides:
        write in class java.io.ByteArrayOutputStream