- java.lang.Object
-
- java.io.OutputStream
-
- com.appslandia.common.base.MemoryStream
-
- All Implemented Interfaces:
Closeable,Flushable,Serializable,AutoCloseable
public class MemoryStream extends OutputStream implements 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(String algorithm)intgetBlockSize()intgetNodeCount()booleanisEmpty()voiditerate(MemoryStream.NodeIterator iterator)voidreset()longsize()byte[]toByteArray()StringtoString()StringtoString(String charset)StringtoString(Charset charset)voidwrite(byte[] b, int off, int len)voidwrite(int b)voidwriteTo(OutputStream out)-
Methods inherited from class java.io.OutputStream
close, flush, nullOutputStream, write
-
-
-
-
Method Detail
-
write
public void write(int b) throws IOException- Specified by:
writein classOutputStream- Throws:
IOException
-
write
public void write(byte[] b, int off, int len) throws IOException- Overrides:
writein classOutputStream- Throws:
IOException
-
writeTo
public void writeTo(OutputStream out) throws IOException
- Throws:
IOException
-
toByteArray
public byte[] toByteArray()
-
getNodeCount
public int getNodeCount()
-
digest
public byte[] digest(String algorithm) throws NoSuchAlgorithmException
- Throws:
NoSuchAlgorithmException
-
iterate
public void iterate(MemoryStream.NodeIterator iterator) throws IOException
- Throws:
IOException
-
toString
public String toString(String charset) throws UnsupportedEncodingException
- Throws:
UnsupportedEncodingException
-
getBlockSize
public int getBlockSize()
-
size
public long size()
-
isEmpty
public boolean isEmpty()
-
reset
public void reset()
-
-