Class MemoryStream

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

    public class MemoryStream
    extends java.io.OutputStream
    implements java.io.Serializable
    Author:
    Loc Ha
    See Also:
    Serialized Form
    • Constructor Detail

      • MemoryStream

        public MemoryStream()
      • MemoryStream

        public MemoryStream​(int blockSize)
    • Method Detail

      • write

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

        public void write​(byte[] b,
                          int off,
                          int len)
                   throws java.io.IOException
        Overrides:
        write in class java.io.OutputStream
        Throws:
        java.io.IOException
      • writeTo

        public void writeTo​(java.io.OutputStream out)
                     throws java.io.IOException
        Throws:
        java.io.IOException
      • toByteArray

        public byte[] toByteArray()
      • getNodeCount

        public int getNodeCount()
      • digest

        public byte[] digest​(java.lang.String algorithm)
                      throws java.security.NoSuchAlgorithmException
        Throws:
        java.security.NoSuchAlgorithmException
      • iterate

        public void iterate​(MemoryStream.NodeIterator iterator)
                     throws java.io.IOException
        Throws:
        java.io.IOException
      • toString

        public java.lang.String toString​(java.nio.charset.Charset charset)
      • toString

        public java.lang.String toString​(java.lang.String charset)
                                  throws java.io.UnsupportedEncodingException
        Throws:
        java.io.UnsupportedEncodingException
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • getBlockSize

        public int getBlockSize()
      • size

        public long size()
      • isEmpty

        public boolean isEmpty()
      • reset

        public void reset()