public class CompressedMarshObjectConvertor extends Resource implements MarshObjectConvertorResource
ResourcePool
only.Modifier and Type | Class and Description |
---|---|
protected static class |
CompressedMarshObjectConvertor.CompressedMarshObjectConvertorFactory |
Constructor and Description |
---|
CompressedMarshObjectConvertor(int level) |
CompressedMarshObjectConvertor(int level,
ISmartLengthBasedCacheCallback cacheCallback) |
Modifier and Type | Method and Description |
---|---|
void |
clear()
Cleans the resource of its contents so it can be returned to the pool.
|
static IResourceFactory<CompressedMarshObjectConvertor> |
getFactory() |
MarshObject |
getMarshObject(Object o)
Convert Object to MarshObject
|
Object |
getObject(MarshObject marsh)
Convert MarshObject to Object
|
protected ObjectInputStream |
getObjectInputStream(InputStream is) |
protected ObjectOutputStream |
getObjectOutputStream(OutputStream is) |
long |
getUsedMemory() |
protected byte[] |
serializeToByteArray(Object o) |
acquire, isAcquired, isFromPool, release, setAcquired, setFromPool
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
acquire, isAcquired, isFromPool, release, setAcquired, setFromPool
public CompressedMarshObjectConvertor(int level)
public CompressedMarshObjectConvertor(int level, ISmartLengthBasedCacheCallback cacheCallback)
level
- the compression level (0-9), The default setting is DEFAULT_COMPRESSION.IllegalArgumentException
- if the compression level is invalidprotected byte[] serializeToByteArray(Object o) throws IOException
IOException
public MarshObject getMarshObject(Object o) throws IOException
IMarshObjectConvertor
getMarshObject
in interface IMarshObjectConvertor
o
- Original objectIOException
public Object getObject(MarshObject marsh) throws IOException, ClassNotFoundException
IMarshObjectConvertor
getObject
in interface IMarshObjectConvertor
marsh
- MarshObject to convertIOException
ClassNotFoundException
protected ObjectOutputStream getObjectOutputStream(OutputStream is) throws IOException
IOException
protected ObjectInputStream getObjectInputStream(InputStream is) throws IOException
IOException
public void clear()
IResource
You may use the
IResource.isFromPool()
indication to decide of a special action before returning a resource to
the pool, or discard any actions on resources not returning to the pool.
clear
in interface IResource
clear
in class Resource
IResource.release()
public static IResourceFactory<CompressedMarshObjectConvertor> getFactory()
public long getUsedMemory()
getUsedMemory
in interface IMemoryAwareResource
Copyright © GigaSpaces.