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
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
void
copyTo
(OutputStream out) only works if no flush has been triggered (aka only write one object per stream instance)final void
ensureCapacity
(int minCapacity) final void
ensureFree
(int free) void
flush()
byte[]
getBuf()
int
getOff()
void
reset()
void
reset
(byte[] out) void
setBuf
(byte[] buf) void
setOutstream
(OutputStream outstream) int
size()
byte[]
void
write
(byte[] b, int off, int len) void
write
(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:
write
in classOutputStream
- Throws:
IOException
-
write
- Overrides:
write
in 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:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Overrides:
close
in classOutputStream
- Throws:
IOException
-
flush
- Specified by:
flush
in interfaceFlushable
- Overrides:
flush
in classOutputStream
- Throws:
IOException
-
reset
public void reset(byte[] out) -
getOff
public int getOff()
-