public abstract class ExternalizableHelper extends BitHelper
Note: This class is configured via the
ExternalizableHelper.xml document located in the same package as
the class. The location of the configuration file can be overridden using
the coherence.externalizable.config
system
property.
Modifier and Type | Class and Description |
---|---|
static class |
ExternalizableHelper.DecoratedMultiBufferReadBuffer
DecoratedMultiBufferReadBuffer is a MultiBufferWriteBuffer that
represents a binary "decorated" value, and allows a more
optimized
getUndecorated(ReadBuffer) operation. |
static class |
ExternalizableHelper.DefaultObjectStreamFactory
Default ObjectStreamFactory implementation.
|
static class |
ExternalizableHelper.FormatAwareCompressor
A DeltaCompressor wrapper implementation that removes/replaces the
serialization format byte (FMT_EXT) before/after delegating to the
underlying compressor.
|
protected static class |
ExternalizableHelper.IntDecoratedObject
Integer decorated object.
|
static interface |
ExternalizableHelper.Shielded
Marker interface.
|
static class |
ExternalizableHelper.ShieldedDataOutputStream
An OutputStream that implements DataOutput that delegates all
operations other than flush and close to an underlying object that
implements DataOutput.
|
static class |
ExternalizableHelper.ShieldedInputStream
An InputStream that delegates all operations other than close to an
underlying InputStream.
|
static class |
ExternalizableHelper.ShieldedObjectOutputStream
An OutputStream that implements ObjectOutput that delegates all
operations other than flush and close to an underlying object that
implements ObjectOutput.
|
static class |
ExternalizableHelper.ShieldedOutputStream
An OutputStream that delegates all operations other than flush and
close to an underlying OutputStream.
|
static class |
ExternalizableHelper.SimpleXmlBeanClassCache
An implementation XmlBeanClassCache that uses a pre-defined list of
XmlBean implementations.
|
protected static class |
ExternalizableHelper.Stats
Serialization statistics for a given user type.
|
static interface |
ExternalizableHelper.XmlBeanClassCache
An interface for caching class reference by integer ID values.
|
Base.LoggingWriter, Base.StackFrame
Modifier and Type | Field and Description |
---|---|
static Converter |
CONVERTER_FROM_BINARY
A converter from Binary to Object format, which uses the DefaultSerializer.
|
static Converter |
CONVERTER_STRIP_INTDECO
A pass-through Binary converter that removes an IntDecoration if present.
|
static Converter |
CONVERTER_TO_BINARY
A converter from Object to Binary format that uses the DefaultSerializer.
|
static int |
DECO_APP_1
Decoration: Application-assignable decoration; this decoration will not
be used, modified or overwritten by Coherence or other Oracle products.
|
static int |
DECO_APP_2
Decoration: Application-assignable decoration; this decoration will not
be used, modified or overwritten by Coherence or other Oracle products.
|
static int |
DECO_APP_3
Decoration: Application-assignable decoration; this decoration will not
be used, modified or overwritten by Coherence or other Oracle products.
|
static int |
DECO_CUSTOM
Decoration: A client specific value (opaque).
|
static int |
DECO_EXPIRY
Decoration: The expiry for the value.
|
static int |
DECO_ID_MAX
Decoration range: The maximum decoration identifier.
|
static int |
DECO_ID_MIN
Decoration range: The minimum decoration identifier.
|
static int |
DECO_JCACHE
Decoration: Holds JCache specific meta-information for an entry.
|
static int |
DECO_JCACHE_SYNTHETIC
Decoration: Indicates if an update or delete is considered
to be synthetic for JCache.
|
static int |
DECO_MEMCACHED
Decoration: Information managed on behalf of Memcached acceptor.
|
static int |
DECO_PUSHREP
Decoration: Information managed on behalf of Push Replication.
|
static int |
DECO_QUEUE_METADATA
Decoration: Information about a queue element
|
static int |
DECO_RSVD_1
Decoration: Reserved for future use by Coherence; do not use.
|
static int |
DECO_RSVD_2
Decoration: Reserved for future use by Coherence; do not use.
|
static int |
DECO_STORE
Decoration: The persistent state for the value.
|
static int |
DECO_TX
Decoration: Information managed on behalf of the transactions
implementation.
|
static int |
DECO_VALUE
Decoration: The original value (before being decorated).
|
static int |
DECO_WLS
Decoration: Information managed on behalf of WebLogic.
|
static Binary[] |
EMPTY_BINARY_ARRAY
An empty array of Binary objects.
|
static int |
FMT_B_ARRAY
Serialization format: Byte array value.
|
static int |
FMT_BIN_DECO
Serialization format: Decorated Binary value.
|
static int |
FMT_BIN_EXT_DECO
Serialization format: Extended-range Decorated Binary value.
|
static int |
FMT_BINARY
Serialization format: Binary value.
|
static int |
FMT_BOOLEAN
Serialization format: Boolean value.
|
static int |
FMT_BYTE
Serialization format: Byte value.
|
static int |
FMT_DECIMAL
Serialization format: BigDecimal value.
|
static int |
FMT_DOUBLE
Serialization format: Double value.
|
static int |
FMT_EXT
Serialization format: A DefaultSerializer is NOT used.
|
static int |
FMT_FLOAT
Serialization format: Float value.
|
static int |
FMT_IDO
Serialization format: Integer-decorated value.
|
static int |
FMT_INT
Serialization format: Integer value.
|
static int |
FMT_INTEGER
Serialization format: BigInteger value.
|
static int |
FMT_LONG
Serialization format: Long value.
|
static int |
FMT_NONE
Serialization format: Unknown value (alias to FMT_UNKNOWN).
|
static int |
FMT_NULL
Serialization format: Null value.
|
static int |
FMT_OBJ_EXT
Serialization format: ExternalizableLite value.
|
static int |
FMT_OBJ_SER
Serialization format: Serializable value.
|
static int |
FMT_OPT
Serialization format: Optional value.
|
static int |
FMT_OPT_DOUBLE
Serialization format: OptionalDouble value.
|
static int |
FMT_OPT_INT
Serialization format: OptionalInt value.
|
static int |
FMT_OPT_LONG
Serialization format: OptionalLong value.
|
static int |
FMT_SHORT
Serialization format: Short value.
|
static int |
FMT_STRING
Serialization format: String value.
|
static int |
FMT_UNKNOWN
Serialization format: Unknown value.
|
static int |
FMT_XML_BEAN
Serialization format: XmlBean value.
|
static int |
FMT_XML_SER
Serialization format: XmlSerializable value.
|
static boolean |
FORCE_RESOLVING_STREAMS
Option: Always use a ResolvingObjectInputStream, even if a regular
ObjectInputStream is available.
|
protected static int |
MAX_DECO_HEADER_BYTES
The maximum number of bytes the header of the binary-decorated value
may contain.
|
static String |
PROPERTY_CONFIG
The name of the system property that can be used to override the location
of the ExternalizableHelper configuration file.
|
static ObjectStreamFactory |
s_streamfactory
Option: Configurable ObjectStreamFactory.
|
static int |
TRINT_DOMAIN_SPAN
Trints use 6 hexits (3 bytes), so the trint domain span is 0x01000000.
|
static int |
TRINT_MAX_VALUE
Trints use 6 hexits (3 bytes), so the trint maximum is 0x00FFFFFF.
|
static int |
TRINT_MAX_VARIANCE
Trints use 6 hexits (3 bytes), so the trint maximum variance (from a
"current" value) is half the trint domain span, or 0x00800000.
|
static boolean |
USE_POF_STREAMS
Option: Use POF as the default serialization format.
|
static boolean |
USE_XMLBEAN_CLASS_CACHE
Option: Use an XmlBean class cache.
|
static ExternalizableHelper.XmlBeanClassCache |
XMLBEAN_CLASS_CACHE
Option: XmlBean class cache implementation.
|
Constructor and Description |
---|
ExternalizableHelper() |
Modifier and Type | Method and Description |
---|---|
static Binary |
asBinary(ReadBuffer buf)
Return a Binary representing the contents of the specified ReadBuffer, or
null if the buffer is null.
|
static int |
calculatePackedLength(int n)
Calculate the number of bytes needed to store a packed integer using
a variable-length format.
|
static int |
calculatePackedLength(long l)
Calculate the number of bytes needed to store a packed long using
a variable-length format.
|
protected static boolean |
checkObjectInputFilter(Class<?> clz,
ObjectInputStream ois)
Return true if the provided class is allowed to be deserialized.
|
static String |
convertUTF(byte[] ab,
int of,
int cb,
char[] ach)
Convert binary UTF-8 encode data to a String.
|
static long |
decodeExpiry(ReadBuffer buf)
Decode the expiry time from the specified ReadBuffer.
|
static Binary |
decorate(Binary bin,
Binary[] abinDecorations)
Deprecated.
as of Coherence 3.7.2
|
static Binary |
decorate(Binary bin,
int nId,
Binary binDecoration)
Decorate the passed value with the specified decoration and return the
resulting Binary.
|
static ExternalizableHelper.IntDecoratedObject |
decorate(Object oValue,
int nDecoration)
Decorate the specified value with the specified integer decoration.
|
static ReadBuffer |
decorate(ReadBuffer bufOrig,
int nId,
ReadBuffer bufDeco)
Decorate the passed value with the specified decoration and return the
resulting ReadBuffer.
|
static ReadBuffer |
decorate(ReadBuffer buf,
ReadBuffer[] abufDeco)
Decorate the passed Binary with the passed decorations.
|
static ReadBuffer |
decorateBinary(ReadBuffer bufValue,
int nDecoration)
Decorate the specified ReadBuffer with the specified integer decoration.
|
static ReadBuffer |
encodeExpiry(ReadBuffer buf,
long ldtExpiry)
Return a ReadBuffer whose contents represent the specified buffer with
the specified expiry encoded as a DECO_EXPIRY decoration.
|
static Serializer |
ensureSerializer(ClassLoader loader)
Obtain a Serializer for the specified ClassLoader.
|
static int |
extractIntDecoration(ReadBuffer buf)
Extract a decoration value from the specified ReadBuffer that contains a
representation of an IntDecoratedObject.
|
static <T> T |
fromBinary(Binary bin)
Read an object from a Binary object.
|
static <T> T |
fromBinary(Binary bin,
ClassLoader loader)
Read an object from a Binary object.
|
static <T> T |
fromBinary(Binary bin,
Serializer serializer)
Read an object from a Binary object using the specified Serializer.
|
static <T> T |
fromBinary(Binary bin,
Serializer serializer,
Class<T> clazz)
Read an object from a Binary object using the specified Serializer and expected class.
|
static <T> T |
fromBinary(Binary bin,
Serializer serializer,
Remote.Function<ReadBuffer.BufferInput,ReadBuffer.BufferInput> supplier)
Read an object from a Binary object using the specified Serializer.
|
static <T> T |
fromBinary(Binary bin,
Serializer serializer,
Remote.Function<ReadBuffer.BufferInput,ReadBuffer.BufferInput> supplier,
Class<T> clazz)
Read an object from a Binary object using the specified Serializer and expected class.
|
static Object |
fromByteArray(byte[] ab)
Read an object from a byte array.
|
static Object |
fromByteArray(byte[] ab,
ClassLoader loader)
Read an object from a byte array.
|
static Class |
getClass(String sClass)
Return class for the specified class name; null if not found.
|
static Binary |
getDecoration(Binary bin,
int nId)
Deprecated.
as of Coherence 3.7.2
|
static ReadBuffer |
getDecoration(ReadBuffer buf,
int nId)
Extract and return the specified decoration from the passed ReadBuffer.
|
static ReadBuffer[] |
getDecorations(ReadBuffer buf)
Return an array containing all of the decorations from the passed
ReadBuffer.
|
static DeltaCompressor |
getDeltaCompressor(Serializer serializer,
DeltaCompressor compressor)
Return a DeltaCompressor suitable for compressing/extracting binaries
produced by ExternalizableHelper using the specified serializer.
|
static InputStream |
getInputStream(DataInput in)
Get an InputStream for the passed DataInput object.
|
static ObjectInput |
getNewObjectInput(DataInput in,
ClassLoader loader)
Get a new ObjectInput for the passed DataInput, even if the passed
DataInput is an ObjectInput.
|
static ObjectInput |
getObjectInput(DataInput in,
ClassLoader loader)
Get an ObjectInput for the passed DataInput object.
|
static ObjectOutput |
getObjectOutput(DataOutput out)
Get an ObjectOutput for the passed DataOutput object.
|
static ObjectStreamFactory |
getObjectStreamFactory()
Return the ObjectStreamFactory used to convert DataInput/Output into
ObjectInput/Output streams.
|
static OutputStream |
getOutputStream(DataOutput out)
Get an OutputStream for the passed DataOutput object.
|
static OutputStream |
getShieldedOutputStream(OutputStream out)
Get a shielded OutputStream for the passed OutputStream object.
|
static int |
getStreamFormat(Object o)
Internal: Select an optimal stream format to use to store the passed
object in a stream (as used by the DefaultSerializer).
|
static Binary |
getUndecorated(Binary bin)
Deprecated.
as of Coherence 3.7.2
|
static ReadBuffer |
getUndecorated(ReadBuffer buf)
If the passed ReadBuffer is decorated, extract the original contents
that the decorations were added to, otherwise return the passed Binary
value.
|
static boolean |
isDecorated(ReadBuffer buf)
If the ReadBuffer is the result of serialization by ExternalizableHelper,
determine if the buffer contains decorations.
|
static boolean |
isDecorated(ReadBuffer buf,
int nId)
If the ReadBuffer is the result of serialization by ExternalizableHelper,
determine if the buffer contains the specified decoration.
|
static boolean |
isIntDecorated(ByteSequence buf)
Check whether or not the specified ByteSequence is a representation of an
IntDecoratedObject.
|
static boolean |
isIntDecorated(ReadBuffer buf)
Deprecated.
use
isIntDecorated(ByteSequence) instead |
static boolean |
isResolving(DataOutput out)
Determine whether the passed DataOutput handles ClassLoader resolving.
|
static boolean |
isSerializable(Object o)
Determine if the resource object can be serialized using the
DefaultSerializer.
|
static boolean |
isSerializerCompatible(Serializer serializerThis,
Serializer serializerThat)
Determines whether or not the specified serializers are compatible.
|
static boolean |
isVersionCompatible(DataInput in,
int nMajor,
int nMinor,
int nMicro,
int nPatchSet,
int nPatch)
Determine whether the sender of the content (the given DataInput)
runs a version that supersedes (greater or equal to) the specified
version.
|
static boolean |
isVersionCompatible(DataOutput out,
int nMajor,
int nMinor,
int nMicro,
int nPatchSet,
int nPatch)
Determine whether all the recipients of the content (the given DataOutput)
run versions that supersede (greater or equal to) the specified
version.
|
static Class |
loadClass(String sClass,
ClassLoader loader1,
ClassLoader loader2)
Attempt to load the specified class using sequentionally all of the
specified loaders, the ContextClassLoader and the current class loader.
|
static URL |
loadResource(String sName,
ClassLoader loader1,
ClassLoader loader2)
Attempt to find a valid, resolvable URL for the specified resource,
first by using each of the specified ClassLoaders, then using the
ContextClassLoader.
|
static void |
main(String[] asArgs)
Parse a hex string representing a serialized object.
|
static int |
makeTrint(long l)
Convert a long integer to a trint.
|
static BigDecimal |
readBigDecimal(DataInput in)
Read a BigDecimal from a DataInput stream.
|
static BigInteger |
readBigInteger(DataInput in)
Read a BigInteger from a DataInput stream.
|
static boolean[] |
readBooleanArray(DataInput in)
Read a packed boolean array.
|
static byte[] |
readByteArray(DataInput in)
Read a variable-length encoded byte array.
|
static int |
readCollection(DataInput in,
Collection collection,
ClassLoader loader)
Read collection content from a DataInput stream and update the
specified collection.
|
static Date |
readDate(DataInput in)
Read a Date from a DataInput stream.
|
static double[] |
readDoubleArray(DataInput in)
Read an array of double numbers from a DataInput stream.
|
static ExternalizableLite |
readExternalizableLite(DataInput in)
Read an ExternalizableLite object from a DataInput stream.
|
static ExternalizableLite |
readExternalizableLite(DataInput in,
ClassLoader loader)
Read an ExternalizableLite object from a DataInput stream.
|
static float[] |
readFloatArray(DataInput in)
Read an array of float numbers from a DataInput stream.
|
static int |
readInt(DataInput in)
Read an int that uses variable length storage in the stream.
|
static int |
readInt(ReadBuffer.BufferInput in)
Read an int that uses variable length storage in the buffer.
|
static int[][] |
readIntArray2d(DataInput in)
Read a 2-dimensional int-array from the stream.
|
static long |
readLong(DataInput in)
Read a long that uses variable length storage in the stream.
|
static long |
readLong(ReadBuffer.BufferInput in)
Read a long that uses variable length storage in the buffer.
|
static int |
readMap(DataInput in,
Map map,
ClassLoader loader)
Read map content from a DataInput stream and update the specified map.
|
static int |
readMap(DataInput in,
Map map,
int cBlock,
ClassLoader loader)
Read map content from a DataInput stream and update the specified map
using the "putAll" method.
|
static <T> T |
readObject(DataInput in)
Read an Object from the passed DataInput object.
|
static <T> T |
readObject(DataInput in,
ClassLoader loader)
Read an Object from the passed DataInput object.
|
static String |
readSafeUTF(DataInput in)
Read a variable-length encoded UTF packed String.
|
static String |
readSafeUTF(ReadBuffer.BufferInput in)
Read a variable-length encoded UTF packed String in the buffer.
|
static Object |
readSerializable(DataInput in)
Read an object from a DataInput stream.
|
static Object |
readSerializable(DataInput in,
ClassLoader loader)
Read an object from a DataInput stream.
|
static String[] |
readStringArray(DataInput in)
Read a String array.
|
static Time |
readTime(DataInput in)
Read a Time from a DataInput stream.
|
static Timestamp |
readTimestamp(DataInput in)
Read a Timestamp from a DataInput stream.
|
static int |
readTrint(DataInput in)
Read a signed three-byte integer value from a stream.
|
static int |
readUnsignedTrint(DataInput in)
Read an unsigned three-byte integer value from a stream.
|
static String |
readUTF(DataInput in)
Read a variable-length encoded UTF packed String.
|
static XmlBean |
readXmlBean(DataInput in,
ClassLoader loader)
Read an XmlBean object from a DataInput stream.
|
static XmlSerializable |
readXmlSerializable(DataInput in)
Read an XmlSerializable object from a DataInput stream.
|
static XmlSerializable |
readXmlSerializable(DataInput in,
ClassLoader loader)
Read an XmlSerializable object from a DataInput stream.
|
static <T> T |
realize(Object o,
Serializer serializer)
Realizes object after deserialization by applying post-serialization rules.
|
static Binary |
removeIntDecoration(Binary bin)
Deprecated.
as of Coherence 3.7.2
|
static ReadBuffer |
removeIntDecoration(ReadBuffer buf)
Remove a decoration value from the specified ReadBuffer that contains
a representation of an IntDecoratedObject.
|
static Object |
replace(Object o)
Potentially replaces specified argument with a different object before
serialization.
|
static void |
reportIncompatibleSerializers(NamedCache cache,
String sService,
Serializer serializer)
Log the message explaining the serializer incompatibility between the
specified cache and a service.
|
static void |
setObjectStreamFactory(ObjectStreamFactory factory)
Specify an ObjectStreamFactory that should be used to convert
DataInput/Output into ObjectInput/Output streams.
|
static Binary |
toBinary(Object o)
Write an object into a Binary object.
|
static Binary |
toBinary(Object o,
Serializer serializer)
Write an object into a Binary object using the specified Serializer.
|
static byte[] |
toByteArray(long l,
byte[] ab)
Convert a long to an 8-byte byte array.
|
static byte[] |
toByteArray(Object o)
Write an object to a byte array.
|
static byte[] |
toByteArray(Object o,
Serializer serializer)
Write an object to a byte array using the specified Serializer.
|
static Binary |
toLiteBinary(ExternalizableLite o)
Write an ExternalizableLite object into a Binary object.
|
static long |
toLong(byte[] ab)
Convert a byte array to a long.
|
static Binary |
undecorate(Binary bin,
int nId)
Deprecated.
as of Coherence 3.7.2
|
static ReadBuffer |
undecorate(ReadBuffer buf,
int nId)
Remove the specified decoration from the passed ReadBuffer and return the
resulting contents (which may be undecorated, or contain the remaining
decorations).
|
static void |
validateBufferSize(int cb)
Verify that the requested buffer size is smaller than the configured
maximum.
|
static void |
writeBigDecimal(DataOutput out,
BigDecimal dec)
Write a BigDecimal to a DataOutput stream.
|
static void |
writeBigInteger(DataOutput out,
BigInteger bigint)
Write a BigInteger to a DataOutput stream.
|
static void |
writeBooleanArray(DataOutput out,
boolean[] af)
Write a packed boolean array.
|
static void |
writeByteArray(DataOutput out,
byte[] ab)
Write a variable-length encoded byte array.
|
static void |
writeCollection(DataOutput out,
Collection collection)
Write collection content to a DataOutput stream.
|
static void |
writeDate(DataOutput out,
Date date)
Write a Date to a DataOutput stream.
|
static void |
writeDoubleArray(DataOutput out,
double[] ad)
Write an array of double numbers to a DataOutput stream.
|
static void |
writeExternalizableLite(DataOutput out,
ExternalizableLite o)
Write an ExternalizableLite object to a DataOutput stream.
|
static void |
writeFloatArray(DataOutput out,
float[] afl)
Write an array of float numbers to a DataOutput stream.
|
static void |
writeInt(DataOutput out,
int n)
Write an int to a stream using a variable length of storage.
|
static void |
writeInt(WriteBuffer.BufferOutput out,
int n)
Write an int to a buffer using a variable length of storage.
|
static void |
writeIntArray2d(DataOutput out,
int[][] aai)
Write a 2-dimensional int-array to the stream
|
static void |
writeLong(DataOutput out,
long l)
Write a long to a stream using a variable length of storage.
|
static void |
writeLong(WriteBuffer.BufferOutput out,
long l)
Write a long to a buffer using a variable length of storage.
|
static void |
writeMap(DataOutput out,
Map map)
Write map content to a DataOutput stream.
|
static void |
writeObject(DataOutput out,
Object o)
Write the specified data to the passed DataOutput object.
|
static void |
writeSafeUTF(DataOutput out,
String s)
Write a variable-length encoded UTF packed String.
|
static void |
writeSafeUTF(WriteBuffer.BufferOutput out,
String s)
Write a variable-length encoded UTF packed String to the buffer.
|
static void |
writeSerializable(DataOutput out,
Object o)
Write an object to a DataOutput stream.
|
static void |
writeStringArray(DataOutput out,
String[] as)
Write a String array.
|
static void |
writeTime(DataOutput out,
Time time)
Write a Time to a DataOutput stream.
|
static void |
writeTimestamp(DataOutput out,
Timestamp dt)
Write a Timestamp to a DataOutput stream.
|
static void |
writeTrint(DataOutput out,
int n)
Write a three-byte integer value to a stream.
|
static void |
writeTrint(DataOutput out,
long l)
Write a three-byte integer value to a stream.
|
static void |
writeUTF(DataOutput out,
String s)
Write a variable-length encoded UTF packed String.
|
static void |
writeXmlBean(DataOutput out,
XmlBean bean)
Write an XmlBean object to a DataOutput stream.
|
static void |
writeXmlSerializable(DataOutput out,
XmlSerializable o)
Write an XmlSerializable object to a DataOutput stream.
|
countBits, countBits, countBits, indexOfLSB, indexOfLSB, indexOfLSB, indexOfMSB, indexOfMSB, indexOfMSB, rotateLeft, rotateLeft, rotateLeft, rotateRight, rotateRight, rotateRight, toBitString, toBitString, toBitString, toBytes, toBytes, toBytes, toBytes, toInt, toInt, toLong
azzert, azzert, azzert, azzertFailed, breakLines, breakLines, capitalize, checkNotEmpty, checkNotNull, checkRange, computeSafeWaitTime, decimalValue, dup, dup, ensureBigDecimal, ensureClassLoader, ensureRuntimeException, ensureRuntimeException, equals, equalsDeep, err, err, err, err, err, escape, formatDateTime, getCallerStackFrame, getCommonMonitor, getCommonMonitor, getCommonMonitor, getContextClassLoader, getContextClassLoader, getDeepMessage, getErr, getLastSafeTimeMillis, getLog, getMaxDecDigits, getMaxHexDigits, getOriginalException, getOut, getProcessRandom, getRandom, getRandomBinary, getRandomBinary, getRandomString, getSafeTimeMillis, getStackFrame, getStackFrames, getStackTrace, getStackTrace, getThreadFactory, getTimeZone, getUpTimeMillis, hashCode, hexValue, indentString, indentString, isDecimal, isHex, isLogEcho, isOctal, log, log, log, log, log, makeInteger, makeLong, makeThread, mod, mod, octalValue, out, out, out, out, out, pad, parseBandwidth, parseBandwidth, parseDelimitedString, parseHex, parseHex, parseMemorySize, parseMemorySize, parsePercentage, parseTime, parseTime, parseTimeNanos, parseTimeNanos, printStackTrace, randomize, randomize, randomize, randomize, read, read, read, read, read, read, read, replace, setErr, setLog, setLogEcho, setOut, sleep, toBandwidthString, toBandwidthString, toCharEscape, toCrc, toCrc, toCrc, toCrc, toCrc, toDecString, toDelimitedString, toDelimitedString, toDelimitedString, toDelimitedString, toHex, toHex, toHexDump, toHexEscape, toHexEscape, toHexEscape, toHexEscape, toHexString, toMemorySizeString, toMemorySizeString, toQuotedCharEscape, toQuotedStringEscape, toSqlString, toString, toString, toStringEscape, toUnicodeEscape, trace, trace, trace, trace, trace, trace, trace, trace, trace, truncateString, truncateString, wait
public static final int FMT_NONE
public static final int FMT_UNKNOWN
public static final int FMT_NULL
public static final int FMT_INT
public static final int FMT_LONG
public static final int FMT_DOUBLE
public static final int FMT_INTEGER
public static final int FMT_DECIMAL
public static final int FMT_STRING
public static final int FMT_BINARY
public static final int FMT_B_ARRAY
public static final int FMT_XML_SER
public static final int FMT_OBJ_EXT
public static final int FMT_OBJ_SER
public static final int FMT_XML_BEAN
public static final int FMT_IDO
public static final int FMT_FLOAT
public static final int FMT_SHORT
public static final int FMT_BYTE
public static final int FMT_BOOLEAN
public static final int FMT_BIN_DECO
Structure is:
byte 0 : format identifier (18) byte 1 : bit mask of decoration identifiers (see DECO_* constants) byte 2 : packed int specifying the length of the first decoration byte next : binary data ...For each decoration, there is a packed int for its length, followed by its binary data. The first decoration is the decorated value itself, if present.
Note: FMT_IDO cannot be combined with FMT_BIN_DECO.
public static final int FMT_BIN_EXT_DECO
Structure is:
byte 0 : format identifier (19) byte 1 : bit mask of decoration identifiers (see DECO_* constants), in the packed long format (1-10 bytes) byte next : packed int specifying the length of the first decoration byte next : binary data ...For each decoration, there is a packed int for its length, followed by its binary data. The first decoration is the decorated value itself, if present.
Note: FMT_IDO cannot be combined with FMT_BIN_EXT_DECO.
public static final int FMT_EXT
public static final int FMT_OPT
public static final int FMT_OPT_INT
public static final int FMT_OPT_LONG
public static final int FMT_OPT_DOUBLE
public static final int DECO_ID_MIN
public static final int DECO_ID_MAX
public static final int DECO_VALUE
public static final int DECO_EXPIRY
public static final int DECO_STORE
public static final int DECO_TX
public static final int DECO_PUSHREP
public static final int DECO_RSVD_2
public static final int DECO_RSVD_1
public static final int DECO_CUSTOM
DECO_APP_1
,
DECO_APP_2
and DECO_APP_3
decorations.public static final int DECO_WLS
public static final int DECO_APP_1
public static final int DECO_APP_2
public static final int DECO_APP_3
public static final int DECO_MEMCACHED
public static final int DECO_JCACHE
public static final int DECO_JCACHE_SYNTHETIC
public static final int DECO_QUEUE_METADATA
protected static final int MAX_DECO_HEADER_BYTES
public static final int TRINT_DOMAIN_SPAN
public static final int TRINT_MAX_VALUE
public static final int TRINT_MAX_VARIANCE
public static final Binary[] EMPTY_BINARY_ARRAY
public static final Converter CONVERTER_TO_BINARY
public static final Converter CONVERTER_FROM_BINARY
public static final Converter CONVERTER_STRIP_INTDECO
public static final String PROPERTY_CONFIG
The value of this property must be the name of a resource that contains an XML document with the structure defined in the /com/tangosol/util/ExternalizableHelper.xml configuration descriptor.
public static final boolean FORCE_RESOLVING_STREAMS
public static final boolean USE_XMLBEAN_CLASS_CACHE
public static final ExternalizableHelper.XmlBeanClassCache XMLBEAN_CLASS_CACHE
public static final boolean USE_POF_STREAMS
public static ObjectStreamFactory s_streamfactory
public static byte[] toByteArray(Object o)
o
- the object to write into a byte arrayWrapperException
- may contain an IOExceptionpublic static byte[] toByteArray(Object o, Serializer serializer)
o
- the object to write into a byte arrayserializer
- the Serializer to useWrapperException
- may contain an IOExceptionpublic static byte[] toByteArray(long l, byte[] ab)
l
- the long to convertab
- the byte array to populate or null if a new byte array should
be createdtoLong(byte[])
public static long toLong(byte[] ab)
ab
- the byte array to converttoByteArray(long, byte[])
public static Object fromByteArray(byte[] ab)
ab
- the byte array containing the objectWrapperException
- may contain an IOExceptionpublic static Object fromByteArray(byte[] ab, ClassLoader loader)
ab
- the byte array containing the objectloader
- the ClassLoader to useWrapperException
- may contain an IOExceptionpublic static Binary toBinary(Object o)
o
- the object to write into a Binary objectWrapperException
- may contain an IOExceptionpublic static Binary toBinary(Object o, Serializer serializer)
o
- the object to write into a Binary objectserializer
- the Serializer to useWrapperException
- may contain an IOExceptionpublic static <T> T fromBinary(Binary bin)
T
- the class of the deserialized objectbin
- the Binary object containing the serialized objectWrapperException
- may contain an IOExceptionpublic static <T> T fromBinary(Binary bin, ClassLoader loader)
T
- the class of the deserialized objectbin
- the Binary object containing the serialized objectloader
- the ClassLoader to useWrapperException
- may contain an IOExceptionpublic static <T> T fromBinary(Binary bin, Serializer serializer)
T
- the class of the deserialized objectbin
- the Binary object containing the serialized objectserializer
- the Serializer to useWrapperException
- may contain an IOExceptionpublic static <T> T fromBinary(Binary bin, Serializer serializer, Class<T> clazz)
T
- the class of the deserialized objectbin
- the Binary object containing the serialized objectserializer
- the Serializer to useclazz
- deserialize object as an instance of this classRuntimeException
- may contain an IOExceptionpublic static <T> T fromBinary(Binary bin, Serializer serializer, Remote.Function<ReadBuffer.BufferInput,ReadBuffer.BufferInput> supplier)
T
- the class of the deserialized objectbin
- the Binary object containing the serialized objectserializer
- the Serializer to usesupplier
- an optional Function that given a BufferInput returns
either the same or another BufferInputRuntimeException
- may contain an IOExceptionpublic static <T> T fromBinary(Binary bin, Serializer serializer, Remote.Function<ReadBuffer.BufferInput,ReadBuffer.BufferInput> supplier, Class<T> clazz)
T
- the class of the deserialized objectbin
- the Binary object containing the serialized objectserializer
- the Serializer to usesupplier
- an optional Function that given a BufferInput returns
either the same or another BufferInputclazz
- deserialize object as an instance of this classRuntimeException
- may contain an IOExceptionpublic static Serializer ensureSerializer(ClassLoader loader)
loader
- a ClassLoaderpublic static Binary toLiteBinary(ExternalizableLite o)
toBinary
, this method only serializes the
object's content and not the identity part. To reconstruct the object
frm that binary you would instantiate and "read" it as follows:
ExternalizableLite o = new MyLiteObject(); o.readExternal(bin.getBufferInput());
o
- the ExternalizableLite object to write into a Binary objectWrapperException
- may contain an IOExceptionpublic static boolean isVersionCompatible(DataInput in, int nMajor, int nMinor, int nMicro, int nPatchSet, int nPatch)
in
- the DataInput to interrogatenMajor
- the major versionnMinor
- the minor versionnMicro
- the micro versionnPatchSet
- the patch set versionnPatch
- the patch versionIllegalArgumentException
- if the DataInput is not a VersionAwareBufferInput
public static boolean isVersionCompatible(DataOutput out, int nMajor, int nMinor, int nMicro, int nPatchSet, int nPatch)
out
- the DataOutput to interrogatenMajor
- the major versionnMinor
- the minor versionnMicro
- the micro versionnPatchSet
- the patch set versionnPatch
- the patch versionIllegalArgumentException
- if the DataOutput is not a VersionAwareBufferOutput
public static int readTrint(DataInput in) throws IOException
in
- DataInput stream to read fromIOException
- if an I/O exception occurspublic static int readUnsignedTrint(DataInput in) throws IOException
in
- DataInput stream to read fromIOException
- if an I/O exception occurspublic static void writeTrint(DataOutput out, int n) throws IOException
out
- DataOutput stream to write ton
- a three-byte integer value passed as an intIOException
- if an I/O exception occurspublic static void writeTrint(DataOutput out, long l) throws IOException
out
- DataOutput stream to write tol
- a three-byte integer value passed as an longIOException
- if an I/O exception occurspublic static int makeTrint(long l)
l
- the long value to convert to a trintpublic static int readInt(ReadBuffer.BufferInput in) throws IOException
in
- a BufferInput to read fromIOException
- if an I/O exception occurspublic static int readInt(DataInput in) throws IOException
in
- a DataInput stream to read fromIOException
- if an I/O exception occurspublic static int calculatePackedLength(int n)
The format differs from DataOutput in that DataOutput always uses a fixed-length 4-byte Big Endian binary format for int values. The "packed" format includes a sign bit (0x40) and a continuation bit (0x80) in the first byte, followed by the least 6 significant bits of the int value. Subsequent bytes (each appearing only if the previous byte had its continuation bit set) include a continuation bit (0x80) and the next least 7 significant bits of the int value. In this way, a 32-bit value is encoded into 1-5 bytes, depending on the magnitude of the int value being encoded.
n
- the value to calculate the packed length ofpublic static void writeInt(WriteBuffer.BufferOutput out, int n) throws IOException
out
- a BufferOutput to write ton
- an int value to writeIOException
- if an I/O exception occurspublic static void writeInt(DataOutput out, int n) throws IOException
out
- a DataOutput stream to write ton
- an int value to writeIOException
- if an I/O exception occurspublic static int[][] readIntArray2d(DataInput in) throws IOException
in
- the input stream to read fromIOException
- if an I/O Exception occurspublic static void writeIntArray2d(DataOutput out, int[][] aai) throws IOException
out
- the output stream to write toaai
- the 2-dimensional int-array to writeIOException
- if an I/O Exception occursNullPointerException
- if the array is nullpublic static long readLong(ReadBuffer.BufferInput in) throws IOException
in
- a DataInput stream to read fromIOException
- if an I/O exception occurspublic static long readLong(DataInput in) throws IOException
in
- a DataInput stream to read fromIOException
- if an I/O exception occurspublic static int calculatePackedLength(long l)
The format differs from DataOutput in that DataOutput always uses a fixed-length 8-byte Big Endian binary format for long values. The "packed" format includes a sign bit (0x40) and a continuation bit (0x80) in the first byte, followed by the least 6 significant bits of the long value. Subsequent bytes (each appearing only if the previous byte had its continuation bit set) include a continuation bit (0x80) and the next least 7 significant bits of the long value. In this way, a 64-bit value is encoded into 1-10 bytes, depending on the magnitude of the long value being encoded.
l
- the long value to calculate the packed length ofpublic static void writeLong(WriteBuffer.BufferOutput out, long l) throws IOException
out
- a BufferOutput stream to write tol
- a long value to writeIOException
- if an I/O exception occurspublic static void writeLong(DataOutput out, long l) throws IOException
out
- a DataOutput stream to write tol
- a long value to writeIOException
- if an I/O exception occurspublic static boolean[] readBooleanArray(DataInput in) throws IOException
in
- a DataInput stream to read fromIOException
- if an I/O exception occurspublic static void writeBooleanArray(DataOutput out, boolean[] af) throws IOException
out
- a DataOutput stream to write toaf
- a boolean array value to writeIOException
- if an I/O exception occursNullPointerException
- if null value if passedpublic static byte[] readByteArray(DataInput in) throws IOException
in
- a DataInput stream to read fromIOException
- if an I/O exception occurspublic static void writeByteArray(DataOutput out, byte[] ab) throws IOException
out
- a DataOutput stream to write toab
- a byte array value to writeIOException
- if an I/O exception occursNullPointerException
- if null value if passedpublic static String readUTF(DataInput in) throws IOException
Note: This format changed in Coherence 3.0; previously the leading integer value was the number of characters, and currently it is the number of bytes as per the java.io package implementations.
in
- a DataInput stream to read fromIOException
- if an I/O exception occurspublic static String convertUTF(byte[] ab, int of, int cb, char[] ach) throws UTFDataFormatException
ab
- an array of bytes containing UTF-8 encoded charactersof
- the offset into the array of the UTF-8 data to decodecb
- the binary length in the array of the UTF-8 data to decodeach
- a temp char array large enough to convert the UTF intoUTFDataFormatException
- if the UTF data is corruptpublic static void writeUTF(DataOutput out, String s) throws IOException
Note: This format changed in Coherence 3.0; previously the leading integer value was the number of characters, and currently it is the number of bytes as per the java.io package implementations.
out
- a DataOutput stream to write tos
- a String value to writeIOException
- if an I/O exception occursNullPointerException
- if null value if passedpublic static String readSafeUTF(ReadBuffer.BufferInput in) throws IOException
in
- a BufferInput to read fromIOException
- if an I/O exception occurspublic static String readSafeUTF(DataInput in) throws IOException
Note: This format changed in Coherence 3.0; previously the leading integer value was the number of characters, and currently it is the number of bytes as per the java.io package implementations.
in
- a DataInput stream to read fromIOException
- if an I/O exception occurspublic static void writeSafeUTF(WriteBuffer.BufferOutput out, String s) throws IOException
out
- a BufferOutput to write tos
- a String value to writeIOException
- if an I/O exception occursNullPointerException
- if null value if passedpublic static void writeSafeUTF(DataOutput out, String s) throws IOException
Note: This format changed in Coherence 3.0; previously the leading integer value was the number of characters, and currently it is the number of bytes as per the java.io package implementations.
out
- a DataOutput stream to write tos
- a String value to write (could be null)IOException
- if an I/O exception occurspublic static String[] readStringArray(DataInput in) throws IOException
in
- a DataInput stream to read fromIOException
- if an I/O exception occurspublic static void writeStringArray(DataOutput out, String[] as) throws IOException
out
- a DataOutput stream to write toas
- a String array to writeIOException
- if an I/O exception occursNullPointerException
- if null value if passedpublic static BigInteger readBigInteger(DataInput in) throws IOException
in
- a DataInput stream to read fromIOException
- if an I/O exception occurspublic static void writeBigInteger(DataOutput out, BigInteger bigint) throws IOException
out
- a DataOutput stream to write tobigint
- a BigInteger value to writeIOException
- if an I/O exception occursNullPointerException
- if null value if passedpublic static BigDecimal readBigDecimal(DataInput in) throws IOException
in
- a DataInput stream to read fromIOException
- if an I/O exception occurspublic static void writeBigDecimal(DataOutput out, BigDecimal dec) throws IOException
out
- a DataOutput stream to write todec
- a BigDecimal value to writeIOException
- if an I/O exception occursNullPointerException
- if null value if passedpublic static Date readDate(DataInput in) throws IOException
in
- a DataInput stream to read fromIOException
- if an I/O exception occurspublic static void writeDate(DataOutput out, Date date) throws IOException
out
- a DataOutput stream to write todate
- a Date value to writeIOException
- if an I/O exception occursNullPointerException
- if null value if passedpublic static Time readTime(DataInput in) throws IOException
in
- a DataInput stream to read fromIOException
- if an I/O exception occurspublic static void writeTime(DataOutput out, Time time) throws IOException
out
- a DataOutput stream to write totime
- a Time value to writeIOException
- if an I/O exception occursNullPointerException
- if null value if passedpublic static Timestamp readTimestamp(DataInput in) throws IOException
in
- a DataInput stream to read fromIOException
- if an I/O exception occurspublic static void writeTimestamp(DataOutput out, Timestamp dt) throws IOException
out
- a DataOutput stream to write todt
- a Timestamp value to writeIOException
- if an I/O exception occursNullPointerException
- if null value if passedpublic static float[] readFloatArray(DataInput in) throws IOException
in
- a DataInput stream to read fromIOException
- if an I/O exception occurspublic static void writeFloatArray(DataOutput out, float[] afl) throws IOException
out
- a DataOutput stream to write toafl
- an array of floats to writeIOException
- if an I/O exception occursNullPointerException
- if null value if passedpublic static double[] readDoubleArray(DataInput in) throws IOException
in
- a DataInput stream to read fromIOException
- if an I/O exception occurspublic static void writeDoubleArray(DataOutput out, double[] ad) throws IOException
out
- a DataOutput stream to write toad
- an array of doubles to writeIOException
- if an I/O exception occursNullPointerException
- if null value if passedpublic static int readMap(DataInput in, Map map, ClassLoader loader) throws IOException
This method reads entries from the stream and "puts" them into the specified map one-by-one using the "put" method.
in
- a DataInput stream to read frommap
- a map to add the entries intoloader
- the ClassLoader to useIOException
- if an I/O exception occursreadMap(DataInput, Map, int, ClassLoader)
public static int readMap(DataInput in, Map map, int cBlock, ClassLoader loader) throws IOException
While the method readMap(DataInput, Map, ClassLoader)
reads
entries from the stream and "puts" them into the specified map
one-by-one, this method collects up to the "block" number of entries
into a temporary map and then updates the passed in map using the
"putAll" method.
in
- a DataInput stream to read frommap
- a map to add the entries intocBlock
- the maximum number of entries to read at onceloader
- the ClassLoader to useIOException
- if an I/O exception occurspublic static void writeMap(DataOutput out, Map map) throws IOException
out
- a DataOutput stream to write tomap
- the map to writeIOException
- if an I/O exception occurspublic static int readCollection(DataInput in, Collection collection, ClassLoader loader) throws IOException
This method reads elements from the stream and adds them into the specified collection one-by-one using the "add" method.
in
- a DataInput stream to read fromcollection
- a collection to add the elements intoloader
- the ClassLoader to useIOException
- if an I/O exception occurspublic static void writeCollection(DataOutput out, Collection collection) throws IOException
out
- a DataOutput stream to write tocollection
- the collection to writeIOException
- if an I/O exception occurspublic static XmlSerializable readXmlSerializable(DataInput in) throws IOException
in
- a DataInput stream to read fromIOException
- if an I/O exception occurspublic static XmlSerializable readXmlSerializable(DataInput in, ClassLoader loader) throws IOException
in
- a DataInput stream to read fromloader
- the ClassLoader to useIOException
- if an I/O exception occurspublic static void writeXmlSerializable(DataOutput out, XmlSerializable o) throws IOException
out
- a DataOutput stream to write too
- an XmlSerializable value to writeIOException
- if an I/O exception occursNullPointerException
- if null value if passedpublic static ExternalizableLite readExternalizableLite(DataInput in) throws IOException
in
- a DataInput stream to read fromIOException
- if an I/O exception occurspublic static ExternalizableLite readExternalizableLite(DataInput in, ClassLoader loader) throws IOException
in
- a DataInput stream to read fromloader
- the ClassLoader to useIOException
- if an I/O exception occurspublic static void writeExternalizableLite(DataOutput out, ExternalizableLite o) throws IOException
out
- a DataOutput stream to write too
- an ExternalizableLite value to writeIOException
- if an I/O exception occursNullPointerException
- if null value if passedpublic static XmlBean readXmlBean(DataInput in, ClassLoader loader) throws IOException
in
- a DataInput stream to read fromloader
- the ClassLoader to useIOException
- if an I/O exception occurspublic static void writeXmlBean(DataOutput out, XmlBean bean) throws IOException
out
- a DataOutput stream to write tobean
- an XmlBean value to writeIOException
- if an I/O exception occursNullPointerException
- if null value if passedpublic static Object readSerializable(DataInput in) throws IOException
in
- a DataInput stream to read fromIOException
- if an I/O exception occurspublic static Object readSerializable(DataInput in, ClassLoader loader) throws IOException
in
- a DataInput stream to read fromloader
- the ClassLoader to useIOException
- if an I/O exception occurspublic static void writeSerializable(DataOutput out, Object o) throws IOException
out
- a DataOutput stream to write too
- a value object to writeIOException
- if an I/O exception occurspublic static <T> T readObject(DataInput in) throws IOException
T
- the class of the object readin
- the DataInput stream to read an object fromIOException
- if an I/O exception occurspublic static <T> T readObject(DataInput in, ClassLoader loader) throws IOException
T
- the class of the object readin
- the DataInput stream to read an object fromloader
- the ClassLoader to useIOException
- if an I/O exception occurspublic static void writeObject(DataOutput out, Object o) throws IOException
out
- the DataOutput stream to write too
- the data to write to the DataOutput; may be nullIOException
- if an I/O exception occurspublic static void validateBufferSize(int cb)
cb
- size of the buffer being requestedBufferOverflowException
- if cb > MAX_BUFFER
public static DeltaCompressor getDeltaCompressor(Serializer serializer, DeltaCompressor compressor)
serializer
- the serializer whose produced binary format is consumed
by the specified compressorcompressor
- the compressorpublic static Class loadClass(String sClass, ClassLoader loader1, ClassLoader loader2) throws ClassNotFoundException
sClass
- the class nameloader1
- first ClassLoader to tryloader2
- second ClassLoader to tryClassNotFoundException
- if all the attempts failpublic static URL loadResource(String sName, ClassLoader loader1, ClassLoader loader2)
sName
- the resource nameloader1
- first ClassLoader to tryloader2
- second ClassLoader to trypublic static InputStream getInputStream(DataInput in)
in
- an Object implementing the DataInput interfacepublic static OutputStream getOutputStream(DataOutput out)
out
- an Object implementing the DataOutput interfacepublic static OutputStream getShieldedOutputStream(OutputStream out)
out
- an OutputStreampublic static ObjectInput getObjectInput(DataInput in, ClassLoader loader) throws IOException
in
- an Object implementing the DataInput interfaceloader
- the ClassLoader to useIOException
- if an I/O exception occurspublic static ObjectInput getNewObjectInput(DataInput in, ClassLoader loader) throws IOException
in
- an Object implementing the DataInput interfaceloader
- the ClassLoader to usein
IOException
- if an I/O exception occurspublic static ObjectOutput getObjectOutput(DataOutput out) throws IOException
out
- an Object implementing the DataOutput interfaceIOException
- if an I/O exception occurspublic static boolean isResolving(DataOutput out)
out
- an object implementing DataOutputpublic static ObjectStreamFactory getObjectStreamFactory()
public static void setObjectStreamFactory(ObjectStreamFactory factory)
Warning: This facility should be used with extreme care; failure to set the ObjectStreamFactory identically on all cluster nodes may render some of all clustered services completely inoperable,
factory
- the ObjectStreamFactory to usepublic static boolean isSerializable(Object o)
o
- the resource objectpublic static int getStreamFormat(Object o)
o
- an Objectpublic static boolean isSerializerCompatible(Serializer serializerThis, Serializer serializerThat)
serializerThis
- the first SerializerserializerThat
- the second Serializerpublic static void reportIncompatibleSerializers(NamedCache cache, String sService, Serializer serializer)
cache
- the NamedCache referencesService
- the service nameserializer
- the serializer used by the servicepublic static boolean isDecorated(ReadBuffer buf)
Note: This method can only be used against ReadBuffers that result from serialization by ExternalizableHelper or buffers that are already decorated.
buf
- the ReadBuffer to checkpublic static boolean isDecorated(ReadBuffer buf, int nId)
Note: This method can only be used against ReadBuffers that result from serialization by ExternalizableHelper or buffers that are already decorated.
buf
- the ReadBuffer to checknId
- the identifier for the decoration to checkpublic static Binary decorate(Binary bin, int nId, Binary binDecoration)
The decoration id must be in range defined by DECO_ID_MIN
and
DECO_ID_MAX
. A series of DECO_* constants are defined
for the pre-approved decorations, including:
DECO_VALUE
stores the original, undecorated value;DECO_EXPIRY
, DECO_STORE
, DECO_TX
and
DECO_PUSHREP
are used by various facilities of Coherence
and DECO_WLS
are assigned to Oracle
products;DECO_APP_1
, DECO_APP_2
and DECO_APP_3
are
made available for use by application developers;DECO_CUSTOM
is another application-definable decoration,
but one that has also been used by Oracle frameworks and products in the
past, which means that a potential exists for collisions.All other potential decoration id values are reserved. Product and framework developers that require a new decoration id to be assigned to them should contact the Coherence product development team.
Note: This method can only be used against Binary values that result from serialization by ExternalizableHelper or Binary values that are already decorated.
bin
- the Binary to decorate, which may already be
decoratednId
- the identifier for the decoration, one of the
DECO_* constantsbinDecoration
- the decoration to apply; a null value will remove
the specified decorationpublic static ReadBuffer decorate(ReadBuffer bufOrig, int nId, ReadBuffer bufDeco)
The decoration id must be in range defined by DECO_ID_MIN
and
DECO_ID_MAX
. A series of DECO_* constants are defined
for the pre-approved decorations, including:
DECO_VALUE
stores the original, undecorated value;DECO_EXPIRY
, DECO_STORE
, DECO_TX
and
DECO_PUSHREP
are used by various facilities of Coherence;DECO_WLS
are assigned to Oracle products;DECO_APP_1
, DECO_APP_2
and DECO_APP_3
are
made available for use by application developers;DECO_CUSTOM
is another application-definable decoration,
but one that has also been used by Oracle frameworks and products in the
past, which means that a potential exists for collisions.All other potential decoration id values are reserved. Product and framework developers that require a new decoration id to be assigned to them should contact the Coherence product development team.
Note: This method can only be used against ReadBuffers that result from serialization by ExternalizableHelper or buffers that are already decorated.
bufOrig
- the ReadBuffer to decorate, which may already be decoratednId
- the identifier for the decoration, one of the
DECO_* constantsbufDeco
- the decoration to apply; a null value will remove the
specified decorationpublic static Binary decorate(Binary bin, Binary[] abinDecorations)
"value"
decoration.
Note: This method can only be used against Binary values that result from serialization by ExternalizableHelper or Binary values that are already decorated.
bin
- the Binary to decorate, which may already be
decorated; may be nullabinDecorations
- the decorations to apply; each non-null element
is assumed to be a decoration to add whose
identifier is its index in the array; the array
contents will not be modified by this methodpublic static ReadBuffer decorate(ReadBuffer buf, ReadBuffer[] abufDeco)
"value"
decoration.
Note: This method can only be used against Binary values that result from serialization by ExternalizableHelper or Binary values that are already decorated.
buf
- the Binary to decorate, which may already be
decorated; may be nullabufDeco
- the decorations to apply; each non-null element
is assumed to be a decoration to add whose
identifier is its index in the array; the array
contents will not be modified by this methodpublic static Binary getDecoration(Binary bin, int nId)
Note: This method can only be used against Binary values that result from serialization by ExternalizableHelper or Binary values that are already decorated.
bin
- the Binary that may be decoratednId
- the identifier for the decorationpublic static ReadBuffer getDecoration(ReadBuffer buf, int nId)
Note: This method can only be used against ReadBuffers that result from serialization by ExternalizableHelper or buffers that are already decorated.
buf
- the ReadBuffer that may be decoratednId
- the identifier for the decorationpublic static ReadBuffer[] getDecorations(ReadBuffer buf)
If the passed value is not decorated, then the result is a single- element array containing the undecorated value, which is the DECO_VALUE decoration.
Note: This method can only be used against ReadBuffers that result from serialization by ExternalizableHelper or buffers that are already decorated.
buf
- the ReadBuffer that may be decoratedpublic static Binary undecorate(Binary bin, int nId)
Note: This method can only be used against Binary values that result from serialization by ExternalizableHelper or Binary values that are already decorated.
bin
- the Binary to undecoratenId
- the identifier for the decoration to removepublic static ReadBuffer undecorate(ReadBuffer buf, int nId)
Note: This method can only be used against ReadBuffers that result from serialization by ExternalizableHelper or buffers that are already decorated.
buf
- the ReadBuffer to undecoratenId
- the identifier for the decoration to removepublic static Binary getUndecorated(Binary bin)
Note: This method can only be used against Binary values that result from serialization by ExternalizableHelper or Binary values that are already decorated.
bin
- the Binary objectpublic static ReadBuffer getUndecorated(ReadBuffer buf)
Note: This method can only be used against ReadBuffers that result from serialization by ExternalizableHelper or buffers that are already decorated.
buf
- the ReadBuffer objectpublic static Binary asBinary(ReadBuffer buf)
buf
- the read bufferpublic static Object replace(Object o) throws ObjectStreamException
o
- the object to replace, if necessaryObjectStreamException
- if an error occurspublic static <T> T realize(Object o, Serializer serializer) throws ObjectStreamException
T
- the class of realized objecto
- the object to realizeserializer
- the serializer that was used to deserialize the objectObjectStreamException
- if an error occurspublic static void main(String[] asArgs)
Example:
java com.tangosol.util.ExternalizableHelper 0x0603486921
asArgs
- the hex string as the command line argumentspublic static ReadBuffer encodeExpiry(ReadBuffer buf, long ldtExpiry)
decodeExpiry(com.tangosol.io.ReadBuffer)
method.buf
- the buffer to encodeldtExpiry
- the expiry time, or CacheMap.EXPIRY_DEFAULT
or
CacheMap.EXPIRY_NEVER
public static long decodeExpiry(ReadBuffer buf)
buf
- the buffer to decodeCacheMap.EXPIRY_DEFAULT
if none existspublic static ExternalizableHelper.IntDecoratedObject decorate(Object oValue, int nDecoration)
oValue
- the value to be decoratednDecoration
- the integer decorationpublic static ReadBuffer decorateBinary(ReadBuffer bufValue, int nDecoration)
bufValue
- the ReadBuffer to be decoratednDecoration
- the integer decoration@Deprecated public static boolean isIntDecorated(ReadBuffer buf)
isIntDecorated(ByteSequence)
insteadbuf
- the ReadBufferpublic static boolean isIntDecorated(ByteSequence buf)
buf
- the ByteSequencepublic static int extractIntDecoration(ReadBuffer buf)
buf
- the ReadBufferpublic static Binary removeIntDecoration(Binary bin)
bin
- the Binary objectpublic static ReadBuffer removeIntDecoration(ReadBuffer buf)
buf
- the ReadBufferprotected static boolean checkObjectInputFilter(Class<?> clz, ObjectInputStream ois)
clz
- the class to be checkedois
- the ObjectInputStream