public class FSTObjectOutput extends DataOutputStream implements ObjectOutput
| Modifier and Type | Field and Description |
|---|---|
FSTClazzNameRegistry |
clnames |
writtenout| Constructor and Description |
|---|
FSTObjectOutput()
serialize without an underlying stream, the resulting byte array of writing to
this FSTObjectOutput can be accessed using getBuffer(), the size using getWritten().
|
FSTObjectOutput(FSTConfiguration conf)
serialize without an underlying stream, the resulting byte array of writing to
this FSTObjectOutput can be accessed using getBuffer(), the size using getWritten().
|
FSTObjectOutput(OutputStream out)
Creates a new FSTObjectOutput stream to write data to the specified
underlying output stream.
|
FSTObjectOutput(OutputStream out,
FSTConfiguration conf)
Creates a new FSTObjectOutput stream to write data to the specified
underlying output stream.
|
| Modifier and Type | Method and Description |
|---|---|
static Class[] |
addToPredictionArray(Class[] possibleClasses,
Class aClass) |
void |
close() |
void |
defaultWriteObject(Object toWrite,
FSTClazzInfo serializationInfo) |
void |
ensureFree(int bytes) |
void |
flush()
Flushes this data output stream.
|
byte[] |
getBuffer() |
FSTClazzInfoRegistry |
getClassInfoRegistry() |
FSTConfiguration |
getConf() |
byte[] |
getCopyOfWrittenBuffer() |
FSTSerialisationListener |
getListener() |
FSTObjectRegistry |
getObjectMap() |
ObjectOutputStream |
getObjectOutputStream(Class cl,
FSTClazzInfo clinfo,
FSTClazzInfo.FSTFieldInfo referencee,
Object toWrite) |
int |
getWriteExternalWriteAhead()
since the stock writeXX methods on InputStream are final, i can't ensure sufficient bufferSize on the output buffer
before calling writeExternal.
|
int |
getWritten() |
static void |
main(String[] arg) |
void |
resetForReUse(OutputStream out)
if out == null => automatically create/reuse a bytebuffer
|
void |
setListener(FSTSerialisationListener listener)
note this might slowdown serialization significatly
|
void |
setWriteExternalWriteAhead(int writeExternalWriteAhead)
since the stock writeXX methods on InputStream are final, i can't ensure sufficient bufferSize on the output buffer
before calling writeExternal.
|
void |
writeCChar(char c) |
void |
writeCCharArr(char[] array) |
void |
writeCDouble(double value) |
void |
writeCDoubleUnsafe(double value) |
void |
writeCFloat(float value)
Writes a 4 byte float.
|
void |
writeCFloatUnsafe(float value)
Writes a 4 byte float.
|
void |
writeCInt(int anInt) |
void |
writeCIntArr(int[] v) |
void |
writeCIntArrUnsafe(int[] v) |
void |
writeClass(Object toWrite) |
void |
writeCLong(long anInt) |
void |
writeCLongUnsafe(long anInt) |
void |
writeCShort(short c) |
void |
writeFBooleanArr(boolean[] array) |
void |
writeFByte(int v) |
void |
writeFByteArr(byte[] array) |
void |
writeFByteUnsafe(int v) |
void |
writeFChar(int v) |
void |
writeFCharArr(char[] array) |
void |
writeFDouble(double value) |
void |
writeFDoubleArr(double[] array) |
void |
writeFDoubleUnsafe(double value) |
void |
writeFFloat(float value)
Writes a 4 byte float.
|
void |
writeFFloatArr(float[] array) |
void |
writeFInt(int v) |
void |
writeFIntArr(int[] v) |
void |
writeFIntThin(int[] v) |
void |
writeFIntUnsafe(int v) |
void |
writeFLong(long v) |
void |
writeFLongArr(long[] array) |
void |
writeFLongArrayUnsafe(long[] arr) |
void |
writeFLongUnsafe(long v) |
void |
writeFShort(int v) |
void |
writeFShortArr(short[] array) |
void |
writeIntArrCompressed(int[] v) |
void |
writeObject(Object obj) |
void |
writeObject(Object obj,
Class... possibles) |
protected void |
writeObjectHeader(FSTClazzInfo clsInfo,
FSTClazzInfo.FSTFieldInfo referencee,
Object toWrite) |
void |
writeObjectInternal(Object obj,
Class... possibles) |
void |
writePlainIntArrUnsafe(int[] v) |
int |
writeStringCompressed(String str) |
void |
writeStringUTF(String str) |
void |
writeStringUTFSpeed(String str) |
void |
writeStringUTFUnsafe(String str) |
size, write, write, writeBoolean, writeByte, writeBytes, writeChar, writeChars, writeDouble, writeFloat, writeInt, writeLong, writeShort, writeUTFwriteclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitwrite, write, writewriteBoolean, writeByte, writeBytes, writeChar, writeChars, writeDouble, writeFloat, writeInt, writeLong, writeShort, writeUTFpublic FSTClazzNameRegistry clnames
public FSTObjectOutput(OutputStream out)
public FSTObjectOutput(OutputStream out, FSTConfiguration conf)
written is
set to zero.
Don't create a FSTConfiguration with each stream, just create one global static configuration and reuse it.
FSTConfiguration is threadsafe.out - the underlying output stream, to be saved for later
use.public FSTObjectOutput(FSTConfiguration conf)
conf - IOExceptionpublic FSTObjectOutput()
IOExceptionpublic void flush()
throws IOException
flush method of DataOutputStream
calls the flush method of its underlying output stream.flush in interface Flushableflush in interface ObjectOutputflush in class DataOutputStreamIOException - if an I/O error occurs.FilterOutputStream.out,
OutputStream.flush()public void close()
throws IOException
close in interface Closeableclose in interface ObjectOutputclose in interface AutoCloseableclose in class FilterOutputStreamIOExceptionpublic int getWriteExternalWriteAhead()
public void setWriteExternalWriteAhead(int writeExternalWriteAhead)
writeExternalWriteAhead - public void ensureFree(int bytes)
throws IOException
IOExceptionpublic void writeObject(Object obj) throws IOException
writeObject in interface ObjectOutputIOExceptionpublic void writeObject(Object obj, Class... possibles) throws IOException
IOExceptionpublic void writeObjectInternal(Object obj, Class... possibles) throws IOException
IOExceptionpublic FSTSerialisationListener getListener()
public void setListener(FSTSerialisationListener listener)
listener - public void defaultWriteObject(Object toWrite, FSTClazzInfo serializationInfo) throws IOException
IOExceptionprotected void writeObjectHeader(FSTClazzInfo clsInfo, FSTClazzInfo.FSTFieldInfo referencee, Object toWrite) throws IOException
IOExceptionpublic void writeFBooleanArr(boolean[] array)
throws IOException
IOExceptionpublic void writeFLongArr(long[] array)
throws IOException
IOExceptionpublic void writeFFloatArr(float[] array)
throws IOException
IOExceptionpublic void writeFDoubleArr(double[] array)
throws IOException
IOExceptionpublic void writeFShortArr(short[] array)
throws IOException
IOExceptionpublic void writeFCharArr(char[] array)
throws IOException
IOExceptionpublic void writeCCharArr(char[] array)
throws IOException
IOExceptionpublic void writeFByteArr(byte[] array)
throws IOException
IOExceptionpublic void writeFLongArrayUnsafe(long[] arr)
throws IOException
IOExceptionpublic int writeStringCompressed(String str) throws IOException
IOExceptionpublic void writeStringUTF(String str) throws IOException
IOExceptionpublic void writeStringUTFSpeed(String str) throws IOException
IOExceptionpublic void writeStringUTFUnsafe(String str) throws IOException
IOExceptionpublic final void writeClass(Object toWrite) throws IOException
IOExceptionpublic static Class[] addToPredictionArray(Class[] possibleClasses, Class aClass)
public void writeCShort(short c)
throws IOException
IOExceptionpublic void writeCChar(char c)
throws IOException
IOExceptionpublic void writeFChar(int v)
throws IOException
IOExceptionpublic void writeFShort(int v)
throws IOException
IOExceptionpublic final void writeFByte(int v)
throws IOException
IOExceptionpublic final void writeFByteUnsafe(int v)
throws IOException
IOExceptionpublic final void writeFIntUnsafe(int v)
throws IOException
IOExceptionpublic void writeFInt(int v)
throws IOException
IOExceptionpublic void writeFLongUnsafe(long v)
throws IOException
IOExceptionpublic void writeFLong(long v)
throws IOException
IOExceptionpublic void writeFIntThin(int[] v)
throws IOException
IOExceptionpublic void writeIntArrCompressed(int[] v)
throws IOException
IOExceptionpublic void writePlainIntArrUnsafe(int[] v)
throws IOException
IOExceptionpublic void writeFIntArr(int[] v)
throws IOException
IOExceptionpublic void writeCIntArr(int[] v)
throws IOException
IOExceptionpublic void writeCIntArrUnsafe(int[] v)
throws IOException
IOExceptionpublic void writeCInt(int anInt)
throws IOException
IOExceptionpublic void writeCFloat(float value)
throws IOException
IOExceptionpublic void writeCFloatUnsafe(float value)
throws IOException
IOExceptionpublic void writeFFloat(float value)
throws IOException
IOExceptionpublic void writeCDouble(double value)
throws IOException
IOExceptionpublic void writeCDoubleUnsafe(double value)
throws IOException
IOExceptionpublic void writeFDouble(double value)
throws IOException
IOExceptionpublic void writeFDoubleUnsafe(double value)
throws IOException
IOExceptionpublic void writeCLongUnsafe(long anInt)
throws IOException
IOExceptionpublic void writeCLong(long anInt)
throws IOException
IOExceptionpublic void resetForReUse(OutputStream out)
out - public FSTClazzInfoRegistry getClassInfoRegistry()
public ObjectOutputStream getObjectOutputStream(Class cl, FSTClazzInfo clinfo, FSTClazzInfo.FSTFieldInfo referencee, Object toWrite) throws IOException
cl - - class or superclass of currently serialized obj, write declared fields of this class onlyclinfo - referencee - toWrite - IOExceptionpublic FSTObjectRegistry getObjectMap()
public byte[] getBuffer()
public byte[] getCopyOfWrittenBuffer()
public FSTConfiguration getConf()
public static void main(String[] arg) throws IOException
IOExceptionpublic int getWritten()
Copyright © 2014. All rights reserved.