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,
IMemoryAwareResourcePool resourcePool) |
CompressedMarshObjectConvertor(int level,
IMemoryAwareResourcePool resourcePool,
ObjectInputStreamFactory objectInputStreamFactory,
boolean idempotent) |
Modifier and Type | Method and Description |
---|---|
void |
clear()
Cleans the resource of its contents so it can be returned to the pool.
|
Object |
fromBinary(byte[] data) |
static IResourceFactory<CompressedMarshObjectConvertor> |
getFactory() |
protected ObjectInputStream |
getObjectInputStream(InputStream is) |
protected ObjectOutputStream |
getObjectOutputStream(OutputStream is) |
long |
getUsedMemory() |
protected byte[] |
serializeToByteArray(Object o) |
byte[] |
toBinary(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)
level
- the compression level (0-9), The default setting is DEFAULT_COMPRESSION.IllegalArgumentException
- if the compression level is invalidpublic CompressedMarshObjectConvertor(int level, IMemoryAwareResourcePool resourcePool)
public CompressedMarshObjectConvertor(int level, IMemoryAwareResourcePool resourcePool, ObjectInputStreamFactory objectInputStreamFactory, boolean idempotent)
protected byte[] serializeToByteArray(Object o) throws IOException
IOException
public byte[] toBinary(Object o) throws IOException
toBinary
in interface IMarshObjectConvertor
IOException
public Object fromBinary(byte[] data) throws IOException, ClassNotFoundException
fromBinary
in interface IMarshObjectConvertor
IOException
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.