public final class FSTConfiguration extends Object
Modifier and Type | Field and Description |
---|---|
static Integer[] |
intObjects |
Modifier and Type | Method and Description |
---|---|
byte[] |
asByteArray(Serializable object)
convenience
|
int |
asByteArray(Serializable object,
int pos,
byte[] targetArray)
serialize object into given byte array at position pos.
|
Object |
asObject(byte[] b)
convenience
|
int |
calcObjectReadTimeNotAUtility(int iterations,
Object obj)
for optimization purposes, do not use to benchmark processing time or in a regular program as
this methods creates a temporary binaryoutputstream and serializes the object in order to measure the
read time in picoseconds.
|
int |
calcObjectSizeBytesNotAUtility(Object obj)
for optimization purposes, do not use to benchmark processing time or in a regular program as
this methods creates a temporary binaryoutputstream and serializes the object in order to measure the
size.
|
int |
calcObjectWriteTimeNotAUtility(int iterations,
Object obj)
for optimization purposes, do not use to benchmark processing time or in a regular program as
this methods creates a temporary binaryoutputstream and serializes the object in order to measure the
write time in micros.
|
void |
clearCaches()
clear cached softref's and ThreadLocal.
|
static FSTConfiguration |
createDefaultConfiguration() |
static FSTConfiguration |
createStructConfiguration() |
Object |
getCachedObject(Class cl) |
FSTClazzInfo |
getClassInfo(Class type) |
ClassLoader |
getClassLoader()
mark the given class as being replaced by a copy of an equal instance.
|
FSTClazzNameRegistry |
getClassRegistry() |
FSTClazzInfo |
getClazzInfo(Class rowClass) |
FSTClazzInfoRegistry |
getCLInfoRegistry() |
FSTObjectCopy |
getCopier() |
static FSTConfiguration |
getDefaultConfiguration() |
static Integer |
getInt(int i) |
FSTObjectInput |
getObjectInput(byte[] arr) |
FSTObjectInput |
getObjectInput(byte[] arr,
int off,
int len)
take the given array as input.
|
FSTObjectInput |
getObjectInput(InputStream in)
utility for thread safety and reuse.
|
FSTObjectOutput |
getObjectOutput() |
FSTObjectOutput |
getObjectOutput(byte[] outByte) |
FSTObjectOutput |
getObjectOutput(OutputStream out)
utility for thread safety and reuse.
|
boolean |
isIgnoreSerialInterfaces() |
boolean |
isPreferSpeed() |
boolean |
isShareReferences() |
void |
registerClass(Class... c)
attention: id should be > CUSTOM_ID_BASE
|
void |
registerSerializer(Class clazz,
FSTObjectSerializer ser,
boolean alsoForAllSubclasses) |
void |
returnObject(Object... cachedObs)
reuse heavy weight objects.
|
void |
setClassLoader(ClassLoader classLoader) |
void |
setIgnoreSerialInterfaces(boolean ignoreSerialInterfaces) |
void |
setPreferSpeed(boolean preferSpeed)
this options lets FST favour speed of encoding over size of the encoded object.
|
void |
setSerializerRegistryDelegate(FSTSerializerRegistryDelegate del)
patch default serializer lookup.
|
void |
setShareReferences(boolean shareReferences)
if false, identical objects will get serialized twice.
|
public static Integer[] intObjects
public static Integer getInt(int i)
public static FSTConfiguration getDefaultConfiguration()
public void setClassLoader(ClassLoader classLoader)
public static FSTConfiguration createDefaultConfiguration()
public void registerSerializer(Class clazz, FSTObjectSerializer ser, boolean alsoForAllSubclasses)
public static FSTConfiguration createStructConfiguration()
public void returnObject(Object... cachedObs)
cachedObs
- public boolean isPreferSpeed()
public void setPreferSpeed(boolean preferSpeed)
preferSpeed
- public int calcObjectSizeBytesNotAUtility(Object obj) throws IOException
IOException
public void setSerializerRegistryDelegate(FSTSerializerRegistryDelegate del)
del
- public int calcObjectWriteTimeNotAUtility(int iterations, Object obj) throws IOException
IOException
public int calcObjectReadTimeNotAUtility(int iterations, Object obj) throws Exception
Exception
public void clearCaches()
public FSTObjectCopy getCopier()
public boolean isShareReferences()
public void setShareReferences(boolean shareReferences)
shareReferences
- public void registerClass(Class... c)
c
- public FSTClazzNameRegistry getClassRegistry()
public FSTClazzInfoRegistry getCLInfoRegistry()
public ClassLoader getClassLoader()
public FSTClazzInfo getClassInfo(Class type)
public FSTObjectInput getObjectInput(InputStream in)
in
- public FSTObjectInput getObjectInput(byte[] arr)
public FSTObjectInput getObjectInput(byte[] arr, int off, int len)
arr
- off
- len
- public FSTObjectOutput getObjectOutput(OutputStream out)
out
- - can be null (temp bytearrays stream is created then)public FSTObjectOutput getObjectOutput()
public FSTObjectOutput getObjectOutput(byte[] outByte)
public void setIgnoreSerialInterfaces(boolean ignoreSerialInterfaces)
public boolean isIgnoreSerialInterfaces()
public FSTClazzInfo getClazzInfo(Class rowClass)
public Object asObject(byte[] b)
public byte[] asByteArray(Serializable object)
public int asByteArray(Serializable object, int pos, byte[] targetArray)
Copyright © 2014. All rights reserved.