Package org.nustaq.serialization
Class FSTObjectOutputNoShared
java.lang.Object
org.nustaq.serialization.FSTObjectOutput
org.nustaq.serialization.FSTObjectOutputNoShared
- All Implemented Interfaces:
DataOutput,ObjectOutput,AutoCloseable
Subclass optimized for "unshared mode". Cycles and Objects referenced more than once will not be detected.
Additionally JDK compatibility is not supported (read/writeObject and stuff). Use case is highperformance
serialization of plain cycle free data (e.g. messaging). Can perform significantly faster (20-40%).
-
Field Summary
Fields inherited from class org.nustaq.serialization.FSTObjectOutput
ARRAY, BIG_BOOLEAN_FALSE, BIG_BOOLEAN_TRUE, BIG_INT, BIG_LONG, closed, codec, conf, curDepth, DIRECT_ARRAY_OBJECT, DIRECT_OBJECT, dontShare, empty, ENUM, HANDLE, isCrossPlatform, listener, NULL, NULL_PLACEHOLDER, OBJECT, objects, ONE_OF, refsLocal, SPECIAL_COMPATIBILITY_OBJECT_TAG, STRING, stringInfo, tmp, TYPED, writeExternalWriteAhead -
Constructor Summary
ConstructorsConstructorDescriptionserialize without an underlying stream, the resulting byte array of writing to this FSTObjectOutput can be accessed using getBuffer(), the size using getWritten().Creates a new FSTObjectOutput stream to write data to the specified underlying output stream.FSTObjectOutputNoShared(OutputStream out, FSTConfiguration conf) Creates a new FSTObjectOutputNoShared stream to write data to the specified underlying output stream.serialize without an underlying stream, the resulting byte array of writing to this FSTObjectOutput can be accessed using getBuffer(), the size using getWritten(). -
Method Summary
Modifier and TypeMethodDescriptionvoidresetForReUse(byte[] out) voidif out == null => automatically create/reuse a bytebufferprotected FSTClazzInfowriteObjectWithContext(FSTClazzInfo.FSTFieldInfo referencee, Object toWrite) Methods inherited from class org.nustaq.serialization.FSTObjectOutput
close, defaultWriteObject, ensureFree, flush, getBuffer, getCachedFI, getClassInfoRegistry, getCodec, getConf, getCopyOfWrittenBuffer, getFstClazzInfo, getListener, getObjectMap, getObjectOutputStream, getWriteExternalWriteAhead, getWritten, objectHasBeenWritten, objectWillBeWritten, resetAndClearRefs, resetForReUse, setCodec, setListener, setWriteExternalWriteAhead, write, write, write, writeArray, writeBoolean, writeByte, writeBytes, writeChar, writeChars, writeClassTag, writeCompatibleObjectFields, writeDouble, writeEnum, writeFloat, writeHandleIfApplicable, writeInt, writeLong, writeObject, writeObject, writeObjectCompatible, writeObjectCompatibleRecursive, writeObjectFields, writeObjectHeader, writeObjectInternal, writeObjectWithContext, writeShort, writeStringUTF, writeUTF
-
Constructor Details
-
FSTObjectOutputNoShared
Creates a new FSTObjectOutput stream to write data to the specified underlying output stream. uses Default Configuration singleton- Parameters:
out-
-
FSTObjectOutputNoShared
Creates a new FSTObjectOutputNoShared stream to write data to the specified underlying output stream. The counterwrittenis set to zero. Don't create a FSTConfiguration with each stream, just create one global static configuration and reuse it. FSTConfiguration is threadsafe.- Parameters:
out- the underlying output stream, to be saved for later use.conf-
-
FSTObjectOutputNoShared
serialize without an underlying stream, the resulting byte array of writing to this FSTObjectOutput can be accessed using getBuffer(), the size using getWritten(). Don't create a FSTConfiguration with each stream, just create one global static configuration and reuseit. FSTConfiguration is threadsafe.- Parameters:
conf-
-
FSTObjectOutputNoShared
public FSTObjectOutputNoShared()serialize without an underlying stream, the resulting byte array of writing to this FSTObjectOutput can be accessed using getBuffer(), the size using getWritten(). uses default configuration singleton
-
-
Method Details
-
writeObjectWithContext
protected FSTClazzInfo writeObjectWithContext(FSTClazzInfo.FSTFieldInfo referencee, Object toWrite) throws IOException - Overrides:
writeObjectWithContextin classFSTObjectOutput- Throws:
IOException
-
resetForReUse
Description copied from class:FSTObjectOutputif out == null => automatically create/reuse a bytebuffer- Overrides:
resetForReUsein classFSTObjectOutput
-
resetForReUse
public void resetForReUse(byte[] out) - Overrides:
resetForReUsein classFSTObjectOutput
-