Package org.nustaq.serialization.util
Class FSTOutputStream
java.lang.Object
java.io.OutputStream
org.nustaq.serialization.util.FSTOutputStream
- All Implemented Interfaces:
Closeable,Flushable,AutoCloseable
Created with IntelliJ IDEA.
User: ruedi
Date: 19.11.12
Time: 10:00
To change this template use File | Settings | File Templates.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()voidcopyTo(OutputStream out) only works if no flush has been triggered (aka only write one object per stream instance)final voidensureCapacity(int minCapacity) final voidensureFree(int free) voidflush()byte[]getBuf()intgetOff()voidreset()voidreset(byte[] out) voidsetBuf(byte[] buf) voidsetOutstream(OutputStream outstream) intsize()byte[]voidwrite(byte[] b, int off, int len) voidwrite(int b) Methods inherited from class java.io.OutputStream
nullOutputStream, write
-
Field Details
-
buf
public byte[] bufThe buffer where data is stored. -
pos
public int posThe number of valid bytes in the buffer.
-
-
Constructor Details
-
FSTOutputStream
-
FSTOutputStream
-
-
Method Details
-
getOutstream
-
setOutstream
-
getBuf
public byte[] getBuf() -
setBuf
public void setBuf(byte[] buf) -
ensureFree
- Throws:
IOException
-
ensureCapacity
- Throws:
IOException
-
write
- Specified by:
writein classOutputStream- Throws:
IOException
-
write
- Overrides:
writein classOutputStream- Throws:
IOException
-
copyTo
only works if no flush has been triggered (aka only write one object per stream instance)- Parameters:
out-- Throws:
IOException
-
reset
public void reset() -
toByteArray
public byte[] toByteArray() -
size
public int size() -
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Overrides:
closein classOutputStream- Throws:
IOException
-
flush
- Specified by:
flushin interfaceFlushable- Overrides:
flushin classOutputStream- Throws:
IOException
-
reset
public void reset(byte[] out) -
getOff
public int getOff()
-