Package com.appslandia.common.base
Class MemoryStream
- java.lang.Object
-
- java.io.OutputStream
-
- com.appslandia.common.base.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
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interfaceMemoryStream.NodeIterator
-
Constructor Summary
Constructors Constructor Description MemoryStream()MemoryStream(int blockSize)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description byte[]digest(java.lang.String algorithm)intgetBlockSize()intgetNodeCount()booleanisEmpty()voiditerate(MemoryStream.NodeIterator iterator)voidreset()longsize()byte[]toByteArray()java.lang.StringtoString()java.lang.StringtoString(java.lang.String charset)java.lang.StringtoString(java.nio.charset.Charset charset)voidwrite(byte[] b, int off, int len)voidwrite(int b)voidwriteTo(java.io.OutputStream out)
-
-
-
Method Detail
-
write
public void write(int b) throws java.io.IOException- Specified by:
writein classjava.io.OutputStream- Throws:
java.io.IOException
-
write
public void write(byte[] b, int off, int len) throws java.io.IOException- Overrides:
writein classjava.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:
toStringin classjava.lang.Object
-
getBlockSize
public int getBlockSize()
-
size
public long size()
-
isEmpty
public boolean isEmpty()
-
reset
public void reset()
-
-