public final class FSTConfiguration extends Object
| Modifier and Type | Class and Description |
|---|---|
static interface |
FSTConfiguration.StreamCoderFactory |
| Modifier and Type | Method and Description |
|---|---|
byte[] |
asByteArray(Object object)
convenience.
|
Object |
asObject(byte[] b)
convenience
|
byte[] |
asSharedByteArray(Object object,
int[] length)
Warning: avoids allocation + copying.
|
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.
|
void |
clearCaches()
clear cached softref's and ThreadLocal.
|
static FSTConfiguration |
createDefaultConfiguration()
the standard FSTConfiguration.
|
static FSTConfiguration |
createFastBinaryConfiguration()
Returns a configuration using Unsafe to read write data.
|
static FSTConfiguration |
createMinBinConfiguration()
Warning: MinBin contains full metainformation (fieldnames,..), so its way slower than the other configs.
|
FSTDecoder |
createStreamDecoder() |
FSTEncoder |
createStreamEncoder() |
static FSTConfiguration |
createStructConfiguration()
special configuration used internally for struct emulation
|
<T> T |
deepCopy(T metadata) |
Object |
getCachedObject(Class cl) |
String |
getClassForCPName(String name) |
FSTClazzInfo |
getClassInfo(Class type) |
ClassLoader |
getClassLoader() |
FSTClazzNameRegistry |
getClassRegistry() |
FSTClazzInfo |
getClazzInfo(Class rowClass) |
FSTClazzInfoRegistry |
getCLInfoRegistry() |
String |
getCPNameForClass(Class cl)
get cross platform symbolic class identifier
|
byte[] |
getCrossPlatformBinaryCache(String symbolicName) |
static FSTConfiguration |
getDefaultConfiguration() |
FSTObjectInput |
getObjectInput() |
FSTObjectInput |
getObjectInput(byte[] arr) |
FSTObjectInput |
getObjectInput(byte[] arr,
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.
|
FSTConfiguration.StreamCoderFactory |
getStreamCoderFactory() |
boolean |
isCrossPlatform() |
boolean |
isForceSerializable() |
boolean |
isPreferSpeed()
ignored currently
|
boolean |
isShareReferences() |
boolean |
isStructMode()
special for structs
|
void |
registerClass(Class... c)
Preregister a class (use at init time).
|
void |
registerCrossPlatformClassBinaryCache(String fulLQName,
byte[] binary) |
void |
registerCrossPlatformClassMapping(String[][] keysAndVals)
init right after creation of configuration, not during operation as it is not threadsafe regarding mutation
currently only for minbin serialization
|
void |
registerCrossPlatformClassMapping(String shortName,
String fqName) |
void |
registerCrossPlatformClassMappingUseSimpleName(Class[] classes)
init right after creation of configuration, not during operation as it is not threadsafe regarding mutation
|
void |
registerCrossPlatformClassMappingUseSimpleName(List<Class> classes) |
void |
registerSerializer(Class clazz,
FSTObjectSerializer ser,
boolean alsoForAllSubclasses)
register a custom serializer for a given class or the class and all of its subclasses.
|
void |
returnObject(Object cached)
reuse heavy weight objects.
|
void |
setClassLoader(ClassLoader classLoader) |
void |
setCrossPlatform(boolean crossPlatform) |
FSTConfiguration |
setForceSerializable(boolean forceSerializable)
treat unserializable classes same as if they would be serializable.
|
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.
|
void |
setStreamCoderFactory(FSTConfiguration.StreamCoderFactory streamCoderFactory)
allows to use subclassed stream codecs.
|
void |
setStructMode(boolean ignoreSerialInterfaces)
ignores all serialization related interfaces (Serializable, Externalizable) and serializes all classes using the
default scheme.
|
public static FSTConfiguration getDefaultConfiguration()
public void setClassLoader(ClassLoader classLoader)
public static FSTConfiguration createMinBinConfiguration()
public static FSTConfiguration createDefaultConfiguration()
public static FSTConfiguration createFastBinaryConfiguration()
public void registerSerializer(Class clazz, FSTObjectSerializer ser, boolean alsoForAllSubclasses)
clazz - ser - alsoForAllSubclasses - public static FSTConfiguration createStructConfiguration()
public FSTConfiguration.StreamCoderFactory getStreamCoderFactory()
public void setStreamCoderFactory(FSTConfiguration.StreamCoderFactory streamCoderFactory)
streamCoderFactory - public void returnObject(Object cached)
cached - public boolean isPreferSpeed()
public void setPreferSpeed(boolean preferSpeed)
preferSpeed - public int calcObjectSizeBytesNotAUtility(Object obj) throws IOException
IOExceptionpublic void setSerializerRegistryDelegate(FSTSerializerRegistryDelegate del)
del - public boolean isForceSerializable()
public FSTConfiguration setForceSerializable(boolean forceSerializable)
forceSerializable - public void clearCaches()
public boolean isShareReferences()
public void setShareReferences(boolean shareReferences)
shareReferences - public void registerClass(Class... c)
public FSTClazzNameRegistry getClassRegistry()
public FSTClazzInfoRegistry getCLInfoRegistry()
public ClassLoader getClassLoader()
public FSTClazzInfo getClassInfo(Class type)
public FSTObjectInput getObjectInput(InputStream in)
in - public FSTObjectInput getObjectInput()
public FSTObjectInput getObjectInput(byte[] arr)
public FSTObjectInput getObjectInput(byte[] arr, int len)
arr - 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 setStructMode(boolean ignoreSerialInterfaces)
ignoreSerialInterfaces - public boolean isStructMode()
public FSTClazzInfo getClazzInfo(Class rowClass)
public void setCrossPlatform(boolean crossPlatform)
public boolean isCrossPlatform()
public <T> T deepCopy(T metadata)
public FSTEncoder createStreamEncoder()
public FSTDecoder createStreamDecoder()
public void registerCrossPlatformClassBinaryCache(String fulLQName, byte[] binary)
public byte[] getCrossPlatformBinaryCache(String symbolicName)
public void registerCrossPlatformClassMapping(String[][] keysAndVals)
keysAndVals - { { "symbolicName", "fullQualifiedClazzName" }, .. }public void registerCrossPlatformClassMapping(String shortName, String fqName)
public void registerCrossPlatformClassMappingUseSimpleName(Class[] classes)
public void registerCrossPlatformClassMappingUseSimpleName(List<Class> classes)
public String getCPNameForClass(Class cl)
cl - public Object asObject(byte[] b)
public byte[] asByteArray(Object object)
public byte[] asSharedByteArray(Object object, int[] length)
Copyright © 2014. All rights reserved.