Skip navigation links

Oracle® Coherence Java API Reference
Release 12.1.2.0.3

E26043-02


com.tangosol.util
Class ExternalizableHelper

java.lang.Object
  extended by com.tangosol.util.Base
      extended by com.tangosol.util.BitHelper
          extended by com.tangosol.util.ExternalizableHelper

Direct Known Subclasses:
ExternalizableHelper.IntDecoratedObject

public abstract class ExternalizableHelper
extends com.tangosol.util.BitHelper

Helpers for the Serializable, Externalizable and the ExternalizableLite interface.

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 tangosol.externalizable.config system property.

Author:
cp 2003.03.28

Nested Class Summary
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.

 

Nested classes/interfaces inherited from class com.tangosol.util.Base
Base.CommonMonitor, Base.LoggingWriter, Base.StackFrame

 

Field Summary
static com.tangosol.util.Converter CONVERTER_FROM_BINARY
          A converter from Binary to Object format, which uses the DefaultSerializer.
static com.tangosol.util.Converter CONVERTER_STRIP_INTDECO
          A pass-through Binary converter that removes an IntDecoration if present.
static com.tangosol.util.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_PUSHREP
          Decoration: Information managed on behalf of Push Replication.
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_TOPLINK
          Decoration: Information managed on behalf of TopLink Grid.
static int DECO_TX
          Decoration: Information managed on behalf of the OptimisticNamedCache implementation.
static int DECO_VALUE
          Decoration: The original value (before being decorated).
static int DECO_WLS
          Decoration: Information managed on behalf of WebLogic.
static com.tangosol.util.Binary[] EMPTY_BINARY_ARRAY
          An empty array of Binary objects.
protected static int FMT_B_ARRAY
          Serialization format: Byte array value.
protected static int FMT_BIN_DECO
          Serialization format: Decorated Binary value.
protected static int FMT_BIN_EXT_DECO
          Serialization format: Extended-range Decorated Binary value.
protected static int FMT_BINARY
          Serialization format: Binary value.
protected static int FMT_BOOLEAN
          Serialization format: Boolean value.
protected static int FMT_BYTE
          Serialization format: Byte value.
protected static int FMT_DECIMAL
          Serialization format: BigDecimal value.
protected static int FMT_DOUBLE
          Serialization format: Double value.
protected static int FMT_EXT
          Serialization format: A DefaultSerializer is NOT used.
protected static int FMT_FLOAT
          Serialization format: Float value.
protected static int FMT_IDO
          Serialization format: Integer-decorated value.
protected static int FMT_INT
          Serialization format: Integer value.
protected static int FMT_INTEGER
          Serialization format: BigInteger value.
protected static int FMT_LONG
          Serialization format: Long value.
protected static int FMT_NONE
          Serialization format: Unknown value (alias to FMT_UNKNOWN).
protected static int FMT_NULL
          Serialization format: Null value.
protected static int FMT_OBJ_EXT
          Serialization format: ExternalizableLite value.
protected static int FMT_OBJ_SER
          Serialization format: Serializable value.
protected static int FMT_SHORT
          Serialization format: Short value.
protected static int FMT_STRING
          Serialization format: String value.
protected static int FMT_UNKNOWN
          Serialization format: Unknown value.
protected static int FMT_XML_BEAN
          Serialization format: XmlBean value.
protected 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 java.lang.String PROPERTY_CONFIG
          The name of the system property that can be used to override the location of the ExternalizableHelper configuration file.
static com.tangosol.io.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_MARSHAL_STREAMS
          Option: Use marshalling object streams that can read classes over the network.
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.

 

Fields inherited from class com.tangosol.util.Base
LOG_ALWAYS, LOG_DEBUG, LOG_ERR, LOG_INFO, LOG_MAX, LOG_MIN, LOG_QUIET, LOG_WARN, POWER_0, POWER_G, POWER_K, POWER_M, POWER_T, UNIT_D, UNIT_H, UNIT_M, UNIT_MS, UNIT_NS, UNIT_S, UNIT_US

 

Constructor Summary
ExternalizableHelper()
           

 

Method Summary
static com.tangosol.util.Binary asBinary(com.tangosol.io.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.
static java.lang.String convertUTF(byte[] ab, int of, int cb, char[] ach)
          Convert binary UTF-8 encode data to a String.
static long decodeExpiry(com.tangosol.io.ReadBuffer buf)
          Decode the expiry time from the specified ReadBuffer.
static com.tangosol.util.Binary decorate(com.tangosol.util.Binary bin, com.tangosol.util.Binary[] abinDecorations)
          Deprecated. as of Coherence 3.7.2
static com.tangosol.util.Binary decorate(com.tangosol.util.Binary bin, int nId, com.tangosol.util.Binary binDecoration)
          Decorate the passed value with the specified decoration and return the resulting Binary.
static ExternalizableHelper.IntDecoratedObject decorate(java.lang.Object oValue, int nDecoration)
          Decorate the specified value with the specified integer decoration.
static com.tangosol.io.ReadBuffer decorate(com.tangosol.io.ReadBuffer bufOrig, int nId, com.tangosol.io.ReadBuffer bufDeco)
          Decorate the passed value with the specified decoration and return the resulting ReadBuffer.
static com.tangosol.io.ReadBuffer decorate(com.tangosol.io.ReadBuffer buf, com.tangosol.io.ReadBuffer[] abufDeco)
          Decorate the passed Binary with the passed decorations.
static com.tangosol.io.ReadBuffer decorateBinary(com.tangosol.io.ReadBuffer bufValue, int nDecoration)
          Decorate the specified ReadBuffer with the specified integer decoration.
static com.tangosol.io.ReadBuffer encodeExpiry(com.tangosol.io.ReadBuffer buf, long ldtExpiry)
          Return a ReadBuffer whose contents represent the specified buffer with the specified expiry encoded as a DECO_EXPIRY decoration.
static com.tangosol.io.Serializer ensureSerializer(java.lang.ClassLoader loader)
          Obtain a Serializer for the specified ClassLoader.
static int extractIntDecoration(com.tangosol.io.ReadBuffer buf)
          Extract a decoration value from the specified ReadBuffer that contains a representation of an IntDecoratedObject.
static java.lang.Object fromBinary(com.tangosol.util.Binary bin)
          Read an object from a Binary object.
static java.lang.Object fromBinary(com.tangosol.util.Binary bin, java.lang.ClassLoader loader)
          Read an object from a Binary object.
static java.lang.Object fromBinary(com.tangosol.util.Binary bin, com.tangosol.io.Serializer serializer)
          Read an object from a Binary object using the specified Serializer.
static java.lang.Object fromByteArray(byte[] ab)
          Read an object from a byte array.
static java.lang.Object fromByteArray(byte[] ab, java.lang.ClassLoader loader)
          Read an object from a byte array.
static com.tangosol.util.Binary getDecoration(com.tangosol.util.Binary bin, int nId)
          Deprecated. as of Coherence 3.7.2
static com.tangosol.io.ReadBuffer getDecoration(com.tangosol.io.ReadBuffer buf, int nId)
          Extract and return the specified decoration from the passed ReadBuffer.
static com.tangosol.io.ReadBuffer[] getDecorations(com.tangosol.io.ReadBuffer buf)
          Return an array containing all of the decorations from the passed ReadBuffer.
static com.tangosol.io.DeltaCompressor getDeltaCompressor(com.tangosol.io.Serializer serializer, com.tangosol.io.DeltaCompressor compressor)
          Return a DeltaCompressor suitable for compressing/extracting binaries produced by ExternalizableHelper using the specified serializer.
static java.io.InputStream getInputStream(java.io.DataInput in)
          Get an InputStream for the passed DataInput object.
static java.io.ObjectInput getNewObjectInput(java.io.DataInput in, java.lang.ClassLoader loader)
          Get a new ObjectInput for the passed DataInput, even if the passed DataInput is an ObjectInput.
static java.io.ObjectInput getObjectInput(java.io.DataInput in, java.lang.ClassLoader loader)
          Get an ObjectInput for the passed DataInput object.
static java.io.ObjectOutput getObjectOutput(java.io.DataOutput out)
          Get an ObjectOutput for the passed DataOutput object.
static com.tangosol.io.ObjectStreamFactory getObjectStreamFactory()
          Return the ObjectStreamFactory used to convert DataInput/Output into ObjectInput/Output streams.
static java.io.OutputStream getOutputStream(java.io.DataOutput out)
          Get an OutputStream for the passed DataOutput object.
static java.io.OutputStream getShieldedOutputStream(java.io.OutputStream out)
          Get a shielded OutputStream for the passed OutputStream object.
protected static int getStreamFormat(java.lang.Object o)
          Internal: Select an optimal stream format to use to store the passed object in a stream (as used by the DefaultSerializer).
static com.tangosol.util.Binary getUndecorated(com.tangosol.util.Binary bin)
          Deprecated. as of Coherence 3.7.2
static com.tangosol.io.ReadBuffer getUndecorated(com.tangosol.io.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(com.tangosol.io.ReadBuffer buf)
          If the ReadBuffer is the result of serialization by ExternalizableHelper, determine if the buffer contains decorations.
static boolean isDecorated(com.tangosol.io.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(com.tangosol.io.ReadBuffer buf)
          Check whether or not the specified ReadBuffer is a representation of an IntDecoratedObject.
static boolean isMarshalled(java.io.DataOutput out)
          Determine whether the passed DataOutput handles marshalling of ObjectOutput.
static boolean isResolving(java.io.DataOutput out)
          Determine whether the passed DataOutput handles ClassLoader resolving.
static boolean isSerializable(java.lang.Object o)
          Determine if the resource object can be serialized using the DefaultSerializer.
static boolean isSerializerCompatible(com.tangosol.io.Serializer serializerThis, com.tangosol.io.Serializer serializerThat)
          Determines whether or not the specified serializers are compatible.
static java.lang.Class loadClass(java.lang.String sClass, java.lang.ClassLoader loader1, java.lang.ClassLoader loader2)
          Attempt to load the specified class using sequentionally all of the specified loaders, the ContextClassLoader and the current class loader.
static java.net.URL loadResource(java.lang.String sName, java.lang.ClassLoader loader1, java.lang.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(java.lang.String[] asArgs)
          Parse a hex string representing a serialized object.
static int makeTrint(long l)
          Convert a long integer to a trint.
static java.math.BigDecimal readBigDecimal(java.io.DataInput in)
          Read a BigDecimal from a DataInput stream.
static java.math.BigInteger readBigInteger(java.io.DataInput in)
          Read a BigInteger from a DataInput stream.
static boolean[] readBooleanArray(java.io.DataInput in)
          Read a packed boolean array.
static byte[] readByteArray(java.io.DataInput in)
          Read a variable-length encoded byte array.
static int readCollection(java.io.DataInput in, java.util.Collection collection, java.lang.ClassLoader loader)
          Read collection content from a DataInput stream and update the specified collection.
static java.sql.Date readDate(java.io.DataInput in)
          Read a Date from a DataInput stream.
static double[] readDoubleArray(java.io.DataInput in)
          Read an array of double numbers from a DataInput stream.
static com.tangosol.io.ExternalizableLite readExternalizableLite(java.io.DataInput in)
          Read an ExternalizableLite object from a DataInput stream.
static com.tangosol.io.ExternalizableLite readExternalizableLite(java.io.DataInput in, java.lang.ClassLoader loader)
          Read an ExternalizableLite object from a DataInput stream.
static float[] readFloatArray(java.io.DataInput in)
          Read an array of float numbers from a DataInput stream.
static int readInt(java.io.DataInput in)
          Read an int that uses variable length storage in the stream.
static int readInt(com.tangosol.io.ReadBuffer.BufferInput in)
          Read an int that uses variable length storage in the buffer.
static long readLong(java.io.DataInput in)
          Read a long that uses variable length storage in the stream.
static long readLong(com.tangosol.io.ReadBuffer.BufferInput in)
          Read a long that uses variable length storage in the buffer.
static int readMap(java.io.DataInput in, java.util.Map map, java.lang.ClassLoader loader)
          Read map content from a DataInput stream and update the specified map.
static int readMap(java.io.DataInput in, java.util.Map map, int cBlock, java.lang.ClassLoader loader)
          Read map content from a DataInput stream and update the specified map using the "putAll" method.
static java.lang.Object readObject(java.io.DataInput in)
          Read an Object from the passed DataInput object.
static java.lang.Object readObject(java.io.DataInput in, java.lang.ClassLoader loader)
          Read an Object from the passed DataInput object.
static java.lang.String readSafeUTF(java.io.DataInput in)
          Read a variable-length encoded UTF packed String.
static java.lang.String readSafeUTF(com.tangosol.io.ReadBuffer.BufferInput in)
          Read a variable-length encoded UTF packed String in the buffer.
static java.lang.Object readSerializable(java.io.DataInput in)
          Read an object from a DataInput stream.
static java.lang.Object readSerializable(java.io.DataInput in, java.lang.ClassLoader loader)
          Read an object from a DataInput stream.
static java.lang.String[] readStringArray(java.io.DataInput in)
          Read a String array.
static java.sql.Time readTime(java.io.DataInput in)
          Read a Time from a DataInput stream.
static java.sql.Timestamp readTimestamp(java.io.DataInput in)
          Read a Timestamp from a DataInput stream.
static int readTrint(java.io.DataInput in)
          Read a signed three-byte integer value from a stream.
static int readUnsignedTrint(java.io.DataInput in)
          Read an unsigned three-byte integer value from a stream.
static java.lang.String readUTF(java.io.DataInput in)
          Read a variable-length encoded UTF packed String.
static com.tangosol.run.xml.XmlBean readXmlBean(java.io.DataInput in, java.lang.ClassLoader loader)
          Read an XmlBean object from a DataInput stream.
static com.tangosol.run.xml.XmlSerializable readXmlSerializable(java.io.DataInput in)
          Read an XmlSerializable object from a DataInput stream.
static com.tangosol.run.xml.XmlSerializable readXmlSerializable(java.io.DataInput in, java.lang.ClassLoader loader)
          Read an XmlSerializable object from a DataInput stream.
static com.tangosol.util.Binary removeIntDecoration(com.tangosol.util.Binary bin)
          Deprecated. as of Coherence 3.7.2
static com.tangosol.io.ReadBuffer removeIntDecoration(com.tangosol.io.ReadBuffer buf)
          Remove a decoration value from the specified ReadBuffer that contains a representation of an IntDecoratedObject.
static void reportIncompatibleSerializers(com.tangosol.net.NamedCache cache, java.lang.String sService, com.tangosol.io.Serializer serializer)
          Log the message explaining the serializer incompatibility between the specified cache and a service.
static void setObjectStreamFactory(com.tangosol.io.ObjectStreamFactory factory)
          Specify an ObjectStreamFactory that should be used to convert DataInput/Output into ObjectInput/Output streams.
static com.tangosol.util.Binary toBinary(java.lang.Object o)
          Write an object into a Binary object.
static com.tangosol.util.Binary toBinary(java.lang.Object o, com.tangosol.io.Serializer serializer)
          Write an object into a Binary object using the specified Serializer.
static byte[] toByteArray(java.lang.Object o)
          Write an object to a byte array.
static byte[] toByteArray(java.lang.Object o, com.tangosol.io.Serializer serializer)
          Write an object to a byte array using the specified Serializer.
static com.tangosol.util.Binary toLiteBinary(com.tangosol.io.ExternalizableLite o)
          Write an ExternalizableLite object into a Binary object.
static com.tangosol.util.Binary undecorate(com.tangosol.util.Binary bin, int nId)
          Deprecated. as of Coherence 3.7.2
static com.tangosol.io.ReadBuffer undecorate(com.tangosol.io.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(java.io.DataOutput out, java.math.BigDecimal dec)
          Write a BigDecimal to a DataOutput stream.
static void writeBigInteger(java.io.DataOutput out, java.math.BigInteger bigint)
          Write a BigInteger to a DataOutput stream.
static void writeBooleanArray(java.io.DataOutput out, boolean[] af)
          Write a packed boolean array.
static void writeByteArray(java.io.DataOutput out, byte[] ab)
          Write a variable-length encoded byte array.
static void writeCollection(java.io.DataOutput out, java.util.Collection collection)
          Write collection content to a DataOutput stream.
static void writeDate(java.io.DataOutput out, java.sql.Date date)
          Write a Date to a DataOutput stream.
static void writeDoubleArray(java.io.DataOutput out, double[] ad)
          Write an array of double numbers to a DataOutput stream.
static void writeExternalizableLite(java.io.DataOutput out, com.tangosol.io.ExternalizableLite o)
          Write an ExternalizableLite object to a DataOutput stream.
static void writeFloatArray(java.io.DataOutput out, float[] afl)
          Write an array of float numbers to a DataOutput stream.
static void writeInt(java.io.DataOutput out, int n)
          Write an int to a stream using a variable length of storage.
static void writeInt(com.tangosol.io.WriteBuffer.BufferOutput out, int n)
          Write an int to a buffer using a variable length of storage.
static void writeLong(java.io.DataOutput out, long l)
          Write a long to a stream using a variable length of storage.
static void writeLong(com.tangosol.io.WriteBuffer.BufferOutput out, long l)
          Write a long to a buffer using a variable length of storage.
static void writeMap(java.io.DataOutput out, java.util.Map map)
          Write map content to a DataOutput stream.
static void writeObject(java.io.DataOutput out, java.lang.Object o)
          Write the specified data to the passed DataOutput object.
static void writeSafeUTF(java.io.DataOutput out, java.lang.String s)
          Write a variable-length encoded UTF packed String.
static void writeSafeUTF(com.tangosol.io.WriteBuffer.BufferOutput out, java.lang.String s)
          Write a variable-length encoded UTF packed String to the buffer.
static void writeSerializable(java.io.DataOutput out, java.lang.Object o)
          Write an object to a DataOutput stream.
static void writeStringArray(java.io.DataOutput out, java.lang.String[] as)
          Write a String array.
static void writeTime(java.io.DataOutput out, java.sql.Time time)
          Write a Time to a DataOutput stream.
static void writeTimestamp(java.io.DataOutput out, java.sql.Timestamp dt)
          Write a Timestamp to a DataOutput stream.
static void writeTrint(java.io.DataOutput out, int n)
          Write a three-byte integer value to a stream.
static void writeTrint(java.io.DataOutput out, long l)
          Write a three-byte integer value to a stream.
static void writeUTF(java.io.DataOutput out, java.lang.String s)
          Write a variable-length encoded UTF packed String.
static void writeXmlBean(java.io.DataOutput out, com.tangosol.run.xml.XmlBean bean)
          Write an XmlBean object to a DataOutput stream.
static void writeXmlSerializable(java.io.DataOutput out, com.tangosol.run.xml.XmlSerializable o)
          Write an XmlSerializable object to a DataOutput stream.

 

Methods inherited from class com.tangosol.util.BitHelper
countBits, countBits, countBits, indexOfLSB, indexOfLSB, indexOfLSB, indexOfMSB, indexOfMSB, indexOfMSB, rotateLeft, rotateLeft, rotateLeft, rotateRight, rotateRight, rotateRight, toBitString, toBitString, toBitString

 

Methods inherited from class com.tangosol.util.Base
azzert, azzert, azzert, azzertFailed, breakLines, breakLines, capitalize, checkNotEmpty, checkNotNull, checkRange, computeSafeWaitTime, decimalValue, dup, dup, 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, getRandom, 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, octalValue, out, out, out, out, out, pad, parseBandwidth, parseBandwidth, parseDelimitedString, parseHex, parseHex, parseMemorySize, parseMemorySize, parsePercentage, parseTime, parseTime, parseTimeNanos, parseTimeNanos, printStackTrace, 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

 

Field Detail

FMT_NONE

protected static final int FMT_NONE
Serialization format: Unknown value (alias to FMT_UNKNOWN).
See Also:
Constant Field Values

FMT_UNKNOWN

protected static final int FMT_UNKNOWN
Serialization format: Unknown value.
See Also:
Constant Field Values

FMT_NULL

protected static final int FMT_NULL
Serialization format: Null value.
See Also:
Constant Field Values

FMT_INT

protected static final int FMT_INT
Serialization format: Integer value.
See Also:
Constant Field Values

FMT_LONG

protected static final int FMT_LONG
Serialization format: Long value.
See Also:
Constant Field Values

FMT_DOUBLE

protected static final int FMT_DOUBLE
Serialization format: Double value.
See Also:
Constant Field Values

FMT_INTEGER

protected static final int FMT_INTEGER
Serialization format: BigInteger value.
See Also:
Constant Field Values

FMT_DECIMAL

protected static final int FMT_DECIMAL
Serialization format: BigDecimal value.
See Also:
Constant Field Values

FMT_STRING

protected static final int FMT_STRING
Serialization format: String value.
See Also:
Constant Field Values

FMT_BINARY

protected static final int FMT_BINARY
Serialization format: Binary value.
See Also:
Constant Field Values

FMT_B_ARRAY

protected static final int FMT_B_ARRAY
Serialization format: Byte array value.
See Also:
Constant Field Values

FMT_XML_SER

protected static final int FMT_XML_SER
Serialization format: XmlSerializable value.
See Also:
Constant Field Values

FMT_OBJ_EXT

protected static final int FMT_OBJ_EXT
Serialization format: ExternalizableLite value.
See Also:
Constant Field Values

FMT_OBJ_SER

protected static final int FMT_OBJ_SER
Serialization format: Serializable value.
See Also:
Constant Field Values

FMT_XML_BEAN

protected static final int FMT_XML_BEAN
Serialization format: XmlBean value.
See Also:
Constant Field Values

FMT_IDO

protected static final int FMT_IDO
Serialization format: Integer-decorated value.
See Also:
Constant Field Values

FMT_FLOAT

protected static final int FMT_FLOAT
Serialization format: Float value.
See Also:
Constant Field Values

FMT_SHORT

protected static final int FMT_SHORT
Serialization format: Short value.
See Also:
Constant Field Values

FMT_BYTE

protected static final int FMT_BYTE
Serialization format: Byte value.
See Also:
Constant Field Values

FMT_BOOLEAN

protected static final int FMT_BOOLEAN
Serialization format: Boolean value.
See Also:
Constant Field Values

FMT_BIN_DECO

protected static final int FMT_BIN_DECO
Serialization format: Decorated Binary value.

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.

See Also:
Constant Field Values

FMT_BIN_EXT_DECO

protected static final int FMT_BIN_EXT_DECO
Serialization format: Extended-range Decorated Binary value.

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.

See Also:
Constant Field Values

FMT_EXT

protected static final int FMT_EXT
Serialization format: A DefaultSerializer is NOT used.
See Also:
Constant Field Values

DECO_ID_MIN

public static final int DECO_ID_MIN
Decoration range: The minimum decoration identifier.
See Also:
Constant Field Values

DECO_ID_MAX

public static final int DECO_ID_MAX
Decoration range: The maximum decoration identifier.
See Also:
Constant Field Values

DECO_VALUE

public static final int DECO_VALUE
Decoration: The original value (before being decorated).
See Also:
Constant Field Values

DECO_EXPIRY

public static final int DECO_EXPIRY
Decoration: The expiry for the value.
See Also:
Constant Field Values

DECO_STORE

public static final int DECO_STORE
Decoration: The persistent state for the value.
See Also:
Constant Field Values

DECO_TX

public static final int DECO_TX
Decoration: Information managed on behalf of the OptimisticNamedCache implementation.
See Also:
Constant Field Values

DECO_PUSHREP

public static final int DECO_PUSHREP
Decoration: Information managed on behalf of Push Replication.
See Also:
Constant Field Values

DECO_RSVD_2

public static final int DECO_RSVD_2
Decoration: Reserved for future use by Coherence; do not use.
See Also:
Constant Field Values

DECO_RSVD_1

public static final int DECO_RSVD_1
Decoration: Reserved for future use by Coherence; do not use.
See Also:
Constant Field Values

DECO_CUSTOM

public static final int DECO_CUSTOM
Decoration: A client specific value (opaque). The original intent of the "custom" decoration was that it would be reserved for use by application code, but previous to Coherence 3.7 it was also used for the OptimisticNamedCache implementation, the TopLink Grid implementation and the Coherence Incubator's "Push Replication" project. As of Coherence 3.7, this attribute is once again made available to frameworks and applications, although care must be taken to avoid using the versions of any of the frameworks that utilized this decoration. Applications are instead encouraged to use the new DECO_APP_1, DECO_APP_2 and DECO_APP_3 decorations.
See Also:
Constant Field Values

DECO_TOPLINK

public static final int DECO_TOPLINK
Decoration: Information managed on behalf of TopLink Grid.
See Also:
Constant Field Values

DECO_WLS

public static final int DECO_WLS
Decoration: Information managed on behalf of WebLogic.
See Also:
Constant Field Values

DECO_APP_1

public static final int DECO_APP_1
Decoration: Application-assignable decoration; this decoration will not be used, modified or overwritten by Coherence or other Oracle products.
See Also:
Constant Field Values

DECO_APP_2

public static final int DECO_APP_2
Decoration: Application-assignable decoration; this decoration will not be used, modified or overwritten by Coherence or other Oracle products.
See Also:
Constant Field Values

DECO_APP_3

public static final int DECO_APP_3
Decoration: Application-assignable decoration; this decoration will not be used, modified or overwritten by Coherence or other Oracle products.
See Also:
Constant Field Values

MAX_DECO_HEADER_BYTES

protected static final int MAX_DECO_HEADER_BYTES
The maximum number of bytes the header of the binary-decorated value may contain.
See Also:
Constant Field Values

TRINT_DOMAIN_SPAN

public static final int TRINT_DOMAIN_SPAN
Trints use 6 hexits (3 bytes), so the trint domain span is 0x01000000.
See Also:
Constant Field Values

TRINT_MAX_VALUE

public static final int TRINT_MAX_VALUE
Trints use 6 hexits (3 bytes), so the trint maximum is 0x00FFFFFF.
See Also:
Constant Field Values

TRINT_MAX_VARIANCE

public static final 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.
See Also:
Constant Field Values

EMPTY_BINARY_ARRAY

public static final com.tangosol.util.Binary[] EMPTY_BINARY_ARRAY
An empty array of Binary objects.

CONVERTER_TO_BINARY

public static final com.tangosol.util.Converter CONVERTER_TO_BINARY
A converter from Object to Binary format that uses the DefaultSerializer.
Since:
Coherence 2.4

CONVERTER_FROM_BINARY

public static final com.tangosol.util.Converter CONVERTER_FROM_BINARY
A converter from Binary to Object format, which uses the DefaultSerializer.
Since:
Coherence 2.4

CONVERTER_STRIP_INTDECO

public static final com.tangosol.util.Converter CONVERTER_STRIP_INTDECO
A pass-through Binary converter that removes an IntDecoration if present.
Since:
Coherence 3.4

PROPERTY_CONFIG

public static final java.lang.String PROPERTY_CONFIG
The name of the system property that can be used to override the location of the ExternalizableHelper configuration file.

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.

See Also:
Constant Field Values

FORCE_RESOLVING_STREAMS

public static final boolean FORCE_RESOLVING_STREAMS
Option: Always use a ResolvingObjectInputStream, even if a regular ObjectInputStream is available.

USE_MARSHAL_STREAMS

public static final boolean USE_MARSHAL_STREAMS
Option: Use marshalling object streams that can read classes over the network.

USE_XMLBEAN_CLASS_CACHE

public static final boolean USE_XMLBEAN_CLASS_CACHE
Option: Use an XmlBean class cache.

XMLBEAN_CLASS_CACHE

public static final ExternalizableHelper.XmlBeanClassCache XMLBEAN_CLASS_CACHE
Option: XmlBean class cache implementation.

USE_POF_STREAMS

public static final boolean USE_POF_STREAMS
Option: Use POF as the default serialization format.

s_streamfactory

public static com.tangosol.io.ObjectStreamFactory s_streamfactory
Option: Configurable ObjectStreamFactory.

Constructor Detail

ExternalizableHelper

public ExternalizableHelper()

Method Detail

toByteArray

public static byte[] toByteArray(java.lang.Object o)
Write an object to a byte array.
Parameters:
o - the object to write into a byte array
Returns:
a byte array containing the serialized form of the passed object
Throws:
WrapperException - may contain an IOException

toByteArray

public static byte[] toByteArray(java.lang.Object o,
                                 com.tangosol.io.Serializer serializer)
Write an object to a byte array using the specified Serializer.
Parameters:
o - the object to write into a byte array
serializer - the Serializer to use
Returns:
a byte array containing the serialized form of the passed object
Throws:
WrapperException - may contain an IOException

fromByteArray

public static java.lang.Object fromByteArray(byte[] ab)
Read an object from a byte array.
Parameters:
ab - the byte array containing the object
Returns:
the object deserialized from the byte array
Throws:
WrapperException - may contain an IOException

fromByteArray

public static java.lang.Object fromByteArray(byte[] ab,
                                             java.lang.ClassLoader loader)
Read an object from a byte array.
Parameters:
ab - the byte array containing the object
loader - the ClassLoader to use
Returns:
the object deserialized from the byte array
Throws:
WrapperException - may contain an IOException

toBinary

public static com.tangosol.util.Binary toBinary(java.lang.Object o)
Write an object into a Binary object.
Parameters:
o - the object to write into a Binary object
Returns:
a Binary object containing a serialized form of the passed object
Throws:
WrapperException - may contain an IOException

toBinary

public static com.tangosol.util.Binary toBinary(java.lang.Object o,
                                                com.tangosol.io.Serializer serializer)
Write an object into a Binary object using the specified Serializer.
Parameters:
o - the object to write into a Binary object
serializer - the Serializer to use
Returns:
a Binary object containing a serialized form of the passed object
Throws:
WrapperException - may contain an IOException

fromBinary

public static java.lang.Object fromBinary(com.tangosol.util.Binary bin)
Read an object from a Binary object.
Parameters:
bin - the Binary object containing the serialized object
Returns:
the object deserialized from the Binary object
Throws:
WrapperException - may contain an IOException

fromBinary

public static java.lang.Object fromBinary(com.tangosol.util.Binary bin,
                                          java.lang.ClassLoader loader)
Read an object from a Binary object.
Parameters:
bin - the Binary object containing the serialized object
loader - the ClassLoader to use
Returns:
the object deserialized from the Binary object
Throws:
WrapperException - may contain an IOException

fromBinary

public static java.lang.Object fromBinary(com.tangosol.util.Binary bin,
                                          com.tangosol.io.Serializer serializer)
Read an object from a Binary object using the specified Serializer.
Parameters:
bin - the Binary object containing the serialized object
serializer - the Serializer to use
Returns:
the object deserialized from the Binary object
Throws:
WrapperException - may contain an IOException

ensureSerializer

public static com.tangosol.io.Serializer ensureSerializer(java.lang.ClassLoader loader)
Obtain a Serializer for the specified ClassLoader. This method is intended to provide configurable indirection for the serialization of application objects.
Parameters:
loader - a ClassLoader
Returns:
the Serializer to use with the specified ClassLoader

toLiteBinary

public static com.tangosol.util.Binary toLiteBinary(com.tangosol.io.ExternalizableLite o)
Write an ExternalizableLite object into a Binary object. Unlike the 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());
 
Parameters:
o - the ExternalizableLite object to write into a Binary object
Returns:
a Binary object containing a serialized form of the passed object
Throws:
WrapperException - may contain an IOException

readTrint

public static int readTrint(java.io.DataInput in)
                     throws java.io.IOException
Read a signed three-byte integer value from a stream.
Parameters:
in - DataInput stream to read from
Returns:
a three-byte signed integer value as an int
Throws:
java.io.IOException - if an I/O exception occurs

readUnsignedTrint

public static int readUnsignedTrint(java.io.DataInput in)
                             throws java.io.IOException
Read an unsigned three-byte integer value from a stream.
Parameters:
in - DataInput stream to read from
Returns:
a three-byte unsigned integer value as an int
Throws:
java.io.IOException - if an I/O exception occurs

writeTrint

public static void writeTrint(java.io.DataOutput out,
                              int n)
                       throws java.io.IOException
Write a three-byte integer value to a stream.
Parameters:
out - DataOutput stream to write to
n - a three-byte integer value passed as an int
Throws:
java.io.IOException - if an I/O exception occurs

writeTrint

public static void writeTrint(java.io.DataOutput out,
                              long l)
                       throws java.io.IOException
Write a three-byte integer value to a stream.
Parameters:
out - DataOutput stream to write to
l - a three-byte integer value passed as an long
Throws:
java.io.IOException - if an I/O exception occurs

makeTrint

public static int makeTrint(long l)
Convert a long integer to a trint.
Parameters:
l - the long value to convert to a trint
Returns:
the equivalent unsigned 3-byte integer value (a "trint")

readInt

public static int readInt(com.tangosol.io.ReadBuffer.BufferInput in)
                   throws java.io.IOException
Read an int that uses variable length storage in the buffer.
Parameters:
in - a BufferInput to read from
Returns:
an int value
Throws:
java.io.IOException - if an I/O exception occurs

readInt

public static int readInt(java.io.DataInput in)
                   throws java.io.IOException
Read an int that uses variable length storage in the stream.
Parameters:
in - a DataInput stream to read from
Returns:
an int value
Throws:
java.io.IOException - if an I/O exception occurs

calculatePackedLength

public static int calculatePackedLength(int n)
Calculate the number of bytes needed to store a packed integer using a variable-length format.

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.

Parameters:
n - the value to calculate the packed length of
Returns:
the number of bytes needed to store the value

writeInt

public static void writeInt(com.tangosol.io.WriteBuffer.BufferOutput out,
                            int n)
                     throws java.io.IOException
Write an int to a buffer using a variable length of storage.
Parameters:
out - a BufferOutput to write to
n - an int value to write
Throws:
java.io.IOException - if an I/O exception occurs

writeInt

public static void writeInt(java.io.DataOutput out,
                            int n)
                     throws java.io.IOException
Write an int to a stream using a variable length of storage.
Parameters:
out - a DataOutput stream to write to
n - an int value to write
Throws:
java.io.IOException - if an I/O exception occurs

readLong

public static long readLong(com.tangosol.io.ReadBuffer.BufferInput in)
                     throws java.io.IOException
Read a long that uses variable length storage in the buffer.
Parameters:
in - a DataInput stream to read from
Returns:
a long value
Throws:
java.io.IOException - if an I/O exception occurs

readLong

public static long readLong(java.io.DataInput in)
                     throws java.io.IOException
Read a long that uses variable length storage in the stream.
Parameters:
in - a DataInput stream to read from
Returns:
a long value
Throws:
java.io.IOException - if an I/O exception occurs

calculatePackedLength

public static int calculatePackedLength(long l)
Calculate the number of bytes needed to store a packed long using a variable-length format.

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.

Parameters:
l - the long value to calculate the packed length of
Returns:
the number of bytes needed to store the value

writeLong

public static void writeLong(com.tangosol.io.WriteBuffer.BufferOutput out,
                             long l)
                      throws java.io.IOException
Write a long to a buffer using a variable length of storage.
Parameters:
out - a BufferOutput stream to write to
l - a long value to write
Throws:
java.io.IOException - if an I/O exception occurs

writeLong

public static void writeLong(java.io.DataOutput out,
                             long l)
                      throws java.io.IOException
Write a long to a stream using a variable length of storage.
Parameters:
out - a DataOutput stream to write to
l - a long value to write
Throws:
java.io.IOException - if an I/O exception occurs

readBooleanArray

public static boolean[] readBooleanArray(java.io.DataInput in)
                                  throws java.io.IOException
Read a packed boolean array.
Parameters:
in - a DataInput stream to read from
Returns:
a boolean array value
Throws:
java.io.IOException - if an I/O exception occurs

writeBooleanArray

public static void writeBooleanArray(java.io.DataOutput out,
                                     boolean[] af)
                              throws java.io.IOException
Write a packed boolean array.
Parameters:
out - a DataOutput stream to write to
af - a boolean array value to write
Throws:
java.io.IOException - if an I/O exception occurs
java.lang.NullPointerException - if null value if passed

readByteArray

public static byte[] readByteArray(java.io.DataInput in)
                            throws java.io.IOException
Read a variable-length encoded byte array.
Parameters:
in - a DataInput stream to read from
Returns:
a byte array value
Throws:
java.io.IOException - if an I/O exception occurs

writeByteArray

public static void writeByteArray(java.io.DataOutput out,
                                  byte[] ab)
                           throws java.io.IOException
Write a variable-length encoded byte array.
Parameters:
out - a DataOutput stream to write to
ab - a byte array value to write
Throws:
java.io.IOException - if an I/O exception occurs
java.lang.NullPointerException - if null value if passed

readUTF

public static java.lang.String readUTF(java.io.DataInput in)
                                throws java.io.IOException
Read a variable-length encoded UTF packed String. The major difference between this implementation and DataInputStream is that this is not limited to 64KB String values.

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.

Parameters:
in - a DataInput stream to read from
Returns:
a String value
Throws:
java.io.IOException - if an I/O exception occurs

convertUTF

public static java.lang.String convertUTF(byte[] ab,
                                          int of,
                                          int cb,
                                          char[] ach)
                                   throws java.io.UTFDataFormatException
Convert binary UTF-8 encode data to a String. This method is a helper to allow various I/O implementations to share a single, efficient implementation.
Parameters:
ab - an array of bytes containing UTF-8 encoded characters
of - the offset into the array of the UTF-8 data to decode
cb - the binary length in the array of the UTF-8 data to decode
ach - a temp char array large enough to convert the UTF into
Returns:
a String value
Throws:
java.io.UTFDataFormatException - if the UTF data is corrupt

writeUTF

public static void writeUTF(java.io.DataOutput out,
                            java.lang.String s)
                     throws java.io.IOException
Write a variable-length encoded UTF packed String. The major difference between this implementation and DataOutput stream is that this is not limited to 64KB String values.

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.

Parameters:
out - a DataOutput stream to write to
s - a String value to write
Throws:
java.io.IOException - if an I/O exception occurs
java.lang.NullPointerException - if null value if passed

readSafeUTF

public static java.lang.String readSafeUTF(com.tangosol.io.ReadBuffer.BufferInput in)
                                    throws java.io.IOException
Read a variable-length encoded UTF packed String in the buffer.
Parameters:
in - a BufferInput to read from
Returns:
a String value
Throws:
java.io.IOException - if an I/O exception occurs

readSafeUTF

public static java.lang.String readSafeUTF(java.io.DataInput in)
                                    throws java.io.IOException
Read a variable-length encoded UTF packed String. The major difference between this implementation and DataInputStream is that this is not limited to 64KB String values and allows null value.

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.

Parameters:
in - a DataInput stream to read from
Returns:
a String value (could be null)
Throws:
java.io.IOException - if an I/O exception occurs

writeSafeUTF

public static void writeSafeUTF(com.tangosol.io.WriteBuffer.BufferOutput out,
                                java.lang.String s)
                         throws java.io.IOException
Write a variable-length encoded UTF packed String to the buffer.
Parameters:
out - a BufferOutput to write to
s - a String value to write
Throws:
java.io.IOException - if an I/O exception occurs
java.lang.NullPointerException - if null value if passed

writeSafeUTF

public static void writeSafeUTF(java.io.DataOutput out,
                                java.lang.String s)
                         throws java.io.IOException
Write a variable-length encoded UTF packed String. The major difference between this implementation and DataOutput stream is that this is not limited to 64KB String values and allows null value.

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.

Parameters:
out - a DataOutput stream to write to
s - a String value to write (could be null)
Throws:
java.io.IOException - if an I/O exception occurs

readStringArray

public static java.lang.String[] readStringArray(java.io.DataInput in)
                                          throws java.io.IOException
Read a String array.
Parameters:
in - a DataInput stream to read from
Returns:
a String array value
Throws:
java.io.IOException - if an I/O exception occurs

writeStringArray

public static void writeStringArray(java.io.DataOutput out,
                                    java.lang.String[] as)
                             throws java.io.IOException
Write a String array.
Parameters:
out - a DataOutput stream to write to
as - a String array to write
Throws:
java.io.IOException - if an I/O exception occurs
java.lang.NullPointerException - if null value if passed

readBigInteger

public static java.math.BigInteger readBigInteger(java.io.DataInput in)
                                           throws java.io.IOException
Read a BigInteger from a DataInput stream.
Parameters:
in - a DataInput stream to read from
Returns:
a BigInteger value
Throws:
java.io.IOException - if an I/O exception occurs

writeBigInteger

public static void writeBigInteger(java.io.DataOutput out,
                                   java.math.BigInteger bigint)
                            throws java.io.IOException
Write a BigInteger to a DataOutput stream.
Parameters:
out - a DataOutput stream to write to
bigint - a BigInteger value to write
Throws:
java.io.IOException - if an I/O exception occurs
java.lang.NullPointerException - if null value if passed

readBigDecimal

public static java.math.BigDecimal readBigDecimal(java.io.DataInput in)
                                           throws java.io.IOException
Read a BigDecimal from a DataInput stream.
Parameters:
in - a DataInput stream to read from
Returns:
a BigDecimal value
Throws:
java.io.IOException - if an I/O exception occurs

writeBigDecimal

public static void writeBigDecimal(java.io.DataOutput out,
                                   java.math.BigDecimal dec)
                            throws java.io.IOException
Write a BigDecimal to a DataOutput stream.
Parameters:
out - a DataOutput stream to write to
dec - a BigDecimal value to write
Throws:
java.io.IOException - if an I/O exception occurs
java.lang.NullPointerException - if null value if passed

readDate

public static java.sql.Date readDate(java.io.DataInput in)
                              throws java.io.IOException
Read a Date from a DataInput stream.
Parameters:
in - a DataInput stream to read from
Returns:
a Date value
Throws:
java.io.IOException - if an I/O exception occurs

writeDate

public static void writeDate(java.io.DataOutput out,
                             java.sql.Date date)
                      throws java.io.IOException
Write a Date to a DataOutput stream.
Parameters:
out - a DataOutput stream to write to
date - a Date value to write
Throws:
java.io.IOException - if an I/O exception occurs
java.lang.NullPointerException - if null value if passed

readTime

public static java.sql.Time readTime(java.io.DataInput in)
                              throws java.io.IOException
Read a Time from a DataInput stream.
Parameters:
in - a DataInput stream to read from
Returns:
a Time value
Throws:
java.io.IOException - if an I/O exception occurs

writeTime

public static void writeTime(java.io.DataOutput out,
                             java.sql.Time time)
                      throws java.io.IOException
Write a Time to a DataOutput stream.
Parameters:
out - a DataOutput stream to write to
time - a Time value to write
Throws:
java.io.IOException - if an I/O exception occurs
java.lang.NullPointerException - if null value if passed

readTimestamp

public static java.sql.Timestamp readTimestamp(java.io.DataInput in)
                                        throws java.io.IOException
Read a Timestamp from a DataInput stream.
Parameters:
in - a DataInput stream to read from
Returns:
a Timestamp value
Throws:
java.io.IOException - if an I/O exception occurs

writeTimestamp

public static void writeTimestamp(java.io.DataOutput out,
                                  java.sql.Timestamp dt)
                           throws java.io.IOException
Write a Timestamp to a DataOutput stream.
Parameters:
out - a DataOutput stream to write to
dt - a Timestamp value to write
Throws:
java.io.IOException - if an I/O exception occurs
java.lang.NullPointerException - if null value if passed

readFloatArray

public static float[] readFloatArray(java.io.DataInput in)
                              throws java.io.IOException
Read an array of float numbers from a DataInput stream.
Parameters:
in - a DataInput stream to read from
Returns:
an array of floats
Throws:
java.io.IOException - if an I/O exception occurs

writeFloatArray

public static void writeFloatArray(java.io.DataOutput out,
                                   float[] afl)
                            throws java.io.IOException
Write an array of float numbers to a DataOutput stream.
Parameters:
out - a DataOutput stream to write to
afl - an array of floats to write
Throws:
java.io.IOException - if an I/O exception occurs
java.lang.NullPointerException - if null value if passed

readDoubleArray

public static double[] readDoubleArray(java.io.DataInput in)
                                throws java.io.IOException
Read an array of double numbers from a DataInput stream.
Parameters:
in - a DataInput stream to read from
Returns:
an array of doubles
Throws:
java.io.IOException - if an I/O exception occurs

writeDoubleArray

public static void writeDoubleArray(java.io.DataOutput out,
                                    double[] ad)
                             throws java.io.IOException
Write an array of double numbers to a DataOutput stream.
Parameters:
out - a DataOutput stream to write to
ad - an array of doubles to write
Throws:
java.io.IOException - if an I/O exception occurs
java.lang.NullPointerException - if null value if passed

readMap

public static int readMap(java.io.DataInput in,
                          java.util.Map map,
                          java.lang.ClassLoader loader)
                   throws java.io.IOException
Read map content from a DataInput stream and update the specified map.

This method reads entries from the stream and "puts" them into the specified map one-by-one using the "put" method.

Parameters:
in - a DataInput stream to read from
map - a map to add the entries into
loader - the ClassLoader to use
Returns:
the number of read and inserted entries
Throws:
java.io.IOException - if an I/O exception occurs
See Also:
readMap(DataInput, Map, int, ClassLoader)

readMap

public static int readMap(java.io.DataInput in,
                          java.util.Map map,
                          int cBlock,
                          java.lang.ClassLoader loader)
                   throws java.io.IOException
Read map content from a DataInput stream and update the specified map using the "putAll" method.

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.

Parameters:
in - a DataInput stream to read from
map - a map to add the entries into
cBlock - the maximum number of entries to read at once
loader - the ClassLoader to use
Returns:
the number of read and inserted entries
Throws:
java.io.IOException - if an I/O exception occurs

writeMap

public static void writeMap(java.io.DataOutput out,
                            java.util.Map map)
                     throws java.io.IOException
Write map content to a DataOutput stream.
Parameters:
out - a DataOutput stream to write to
map - the map to write
Throws:
java.io.IOException - if an I/O exception occurs

readCollection

public static int readCollection(java.io.DataInput in,
                                 java.util.Collection collection,
                                 java.lang.ClassLoader loader)
                          throws java.io.IOException
Read collection content from a DataInput stream and update the specified collection.

This method reads elements from the stream and adds them into the specified collection one-by-one using the "add" method.

Parameters:
in - a DataInput stream to read from
collection - a collection to add the elements into
loader - the ClassLoader to use
Returns:
the number of read and inserted elements
Throws:
java.io.IOException - if an I/O exception occurs

writeCollection

public static void writeCollection(java.io.DataOutput out,
                                   java.util.Collection collection)
                            throws java.io.IOException
Write collection content to a DataOutput stream.
Parameters:
out - a DataOutput stream to write to
collection - the collection to write
Throws:
java.io.IOException - if an I/O exception occurs

readXmlSerializable

public static com.tangosol.run.xml.XmlSerializable readXmlSerializable(java.io.DataInput in)
                                                                throws java.io.IOException
Read an XmlSerializable object from a DataInput stream.
Parameters:
in - a DataInput stream to read from
Returns:
an XmlSerializable value
Throws:
java.io.IOException - if an I/O exception occurs

readXmlSerializable

public static com.tangosol.run.xml.XmlSerializable readXmlSerializable(java.io.DataInput in,
                                                                       java.lang.ClassLoader loader)
                                                                throws java.io.IOException
Read an XmlSerializable object from a DataInput stream.
Parameters:
in - a DataInput stream to read from
loader - the ClassLoader to use
Returns:
an XmlSerializable value
Throws:
java.io.IOException - if an I/O exception occurs

writeXmlSerializable

public static void writeXmlSerializable(java.io.DataOutput out,
                                        com.tangosol.run.xml.XmlSerializable o)
                                 throws java.io.IOException
Write an XmlSerializable object to a DataOutput stream.
Parameters:
out - a DataOutput stream to write to
o - an XmlSerializable value to write
Throws:
java.io.IOException - if an I/O exception occurs
java.lang.NullPointerException - if null value if passed

readExternalizableLite

public static com.tangosol.io.ExternalizableLite readExternalizableLite(java.io.DataInput in)
                                                                 throws java.io.IOException
Read an ExternalizableLite object from a DataInput stream.
Parameters:
in - a DataInput stream to read from
Returns:
an ExternalizableLite value
Throws:
java.io.IOException - if an I/O exception occurs

readExternalizableLite

public static com.tangosol.io.ExternalizableLite readExternalizableLite(java.io.DataInput in,
                                                                        java.lang.ClassLoader loader)
                                                                 throws java.io.IOException
Read an ExternalizableLite object from a DataInput stream.
Parameters:
in - a DataInput stream to read from
loader - the ClassLoader to use
Returns:
an ExternalizableLite value
Throws:
java.io.IOException - if an I/O exception occurs

writeExternalizableLite

public static void writeExternalizableLite(java.io.DataOutput out,
                                           com.tangosol.io.ExternalizableLite o)
                                    throws java.io.IOException
Write an ExternalizableLite object to a DataOutput stream.
Parameters:
out - a DataOutput stream to write to
o - an ExternalizableLite value to write
Throws:
java.io.IOException - if an I/O exception occurs
java.lang.NullPointerException - if null value if passed

readXmlBean

public static com.tangosol.run.xml.XmlBean readXmlBean(java.io.DataInput in,
                                                       java.lang.ClassLoader loader)
                                                throws java.io.IOException
Read an XmlBean object from a DataInput stream.
Parameters:
in - a DataInput stream to read from
loader - the ClassLoader to use
Returns:
an XmlBean value
Throws:
java.io.IOException - if an I/O exception occurs

writeXmlBean

public static void writeXmlBean(java.io.DataOutput out,
                                com.tangosol.run.xml.XmlBean bean)
                         throws java.io.IOException
Write an XmlBean object to a DataOutput stream.
Parameters:
out - a DataOutput stream to write to
bean - an XmlBean value to write
Throws:
java.io.IOException - if an I/O exception occurs
java.lang.NullPointerException - if null value if passed

readSerializable

public static java.lang.Object readSerializable(java.io.DataInput in)
                                         throws java.io.IOException
Read an object from a DataInput stream.
Parameters:
in - a DataInput stream to read from
Returns:
a value object
Throws:
java.io.IOException - if an I/O exception occurs

readSerializable

public static java.lang.Object readSerializable(java.io.DataInput in,
                                                java.lang.ClassLoader loader)
                                         throws java.io.IOException
Read an object from a DataInput stream.
Parameters:
in - a DataInput stream to read from
loader - the ClassLoader to use
Returns:
a value object
Throws:
java.io.IOException - if an I/O exception occurs

writeSerializable

public static void writeSerializable(java.io.DataOutput out,
                                     java.lang.Object o)
                              throws java.io.IOException
Write an object to a DataOutput stream.
Parameters:
out - a DataOutput stream to write to
o - a value object to write
Throws:
java.io.IOException - if an I/O exception occurs

readObject

public static java.lang.Object readObject(java.io.DataInput in)
                                   throws java.io.IOException
Read an Object from the passed DataInput object.
Parameters:
in - the DataInput stream to read an object from
Returns:
the object read from the DataInput; may be null
Throws:
java.io.IOException - if an I/O exception occurs

readObject

public static java.lang.Object readObject(java.io.DataInput in,
                                          java.lang.ClassLoader loader)
                                   throws java.io.IOException
Read an Object from the passed DataInput object.
Parameters:
in - the DataInput stream to read an object from
loader - the ClassLoader to use
Returns:
the object read from the DataInput; may be null
Throws:
java.io.IOException - if an I/O exception occurs

writeObject

public static void writeObject(java.io.DataOutput out,
                               java.lang.Object o)
                        throws java.io.IOException
Write the specified data to the passed DataOutput object.
Parameters:
out - the DataOutput stream to write to
o - the data to write to the DataOutput; may be null
Throws:
java.io.IOException - if an I/O exception occurs

validateBufferSize

public static void validateBufferSize(int cb)
Verify that the requested buffer size is smaller than the configured maximum.
Parameters:
cb - size of the buffer being requested
Throws:
java.nio.BufferOverflowException - if cb > MAX_BUFFER

getDeltaCompressor

public static com.tangosol.io.DeltaCompressor getDeltaCompressor(com.tangosol.io.Serializer serializer,
                                                                 com.tangosol.io.DeltaCompressor compressor)
Return a DeltaCompressor suitable for compressing/extracting binaries produced by ExternalizableHelper using the specified serializer. The returned DeltaCompressor will use the specified compressor to compress/extract binaries in the format produced directly by the specified serializer.
Parameters:
serializer - the serializer whose produced binary format is consumed by the specified compressor
compressor - the compressor

loadClass

public static java.lang.Class loadClass(java.lang.String sClass,
                                        java.lang.ClassLoader loader1,
                                        java.lang.ClassLoader loader2)
                                 throws java.lang.ClassNotFoundException
Attempt to load the specified class using sequentionally all of the specified loaders, the ContextClassLoader and the current class loader.
Parameters:
sClass - the class name
loader1 - first ClassLoader to try
loader2 - second ClassLoader to try
Returns:
the Class for the specified name
Throws:
java.lang.ClassNotFoundException - if all the attempts fail

loadResource

public static java.net.URL loadResource(java.lang.String sName,
                                        java.lang.ClassLoader loader1,
                                        java.lang.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.
Parameters:
sName - the resource name
loader1 - first ClassLoader to try
loader2 - second ClassLoader to try
Returns:
the URL for the specified resource name, or null if the resource could not be found

getInputStream

public static java.io.InputStream getInputStream(java.io.DataInput in)
Get an InputStream for the passed DataInput object.
Parameters:
in - an Object implementing the DataInput interface
Returns:
an Object of type InputStream

getOutputStream

public static java.io.OutputStream getOutputStream(java.io.DataOutput out)
Get an OutputStream for the passed DataOutput object.
Parameters:
out - an Object implementing the DataOutput interface
Returns:
an Object of type OutputStream

getShieldedOutputStream

public static java.io.OutputStream getShieldedOutputStream(java.io.OutputStream out)
Get a shielded OutputStream for the passed OutputStream object.
Parameters:
out - an OutputStream
Returns:
an OutputStream that implements the Shielded interface

getObjectInput

public static java.io.ObjectInput getObjectInput(java.io.DataInput in,
                                                 java.lang.ClassLoader loader)
                                          throws java.io.IOException
Get an ObjectInput for the passed DataInput object.
Parameters:
in - an Object implementing the DataInput interface
loader - the ClassLoader to use
Returns:
an Object of type ObjectInput
Throws:
java.io.IOException - if an I/O exception occurs

getNewObjectInput

public static java.io.ObjectInput getNewObjectInput(java.io.DataInput in,
                                                    java.lang.ClassLoader loader)
                                             throws java.io.IOException
Get a new ObjectInput for the passed DataInput, even if the passed DataInput is an ObjectInput.
Parameters:
in - an Object implementing the DataInput interface
loader - the ClassLoader to use
Returns:
an Object of type ObjectInput that is guaranteed not to be the same reference as in
Throws:
java.io.IOException - if an I/O exception occurs

getObjectOutput

public static java.io.ObjectOutput getObjectOutput(java.io.DataOutput out)
                                            throws java.io.IOException
Get an ObjectOutput for the passed DataOutput object.
Parameters:
out - an Object implementing the DataOutput interface
Returns:
an Object of type ObjectOutput
Throws:
java.io.IOException - if an I/O exception occurs

isMarshalled

public static boolean isMarshalled(java.io.DataOutput out)
Determine whether the passed DataOutput handles marshalling of ObjectOutput.
Parameters:
out - an object implementing DataOutput
Returns:
true if the object implementing DataOutput also implements ObjectOutput and handles marshalling
Throws:
java.io.IOException - if an I/O exception occurs

isResolving

public static boolean isResolving(java.io.DataOutput out)
Determine whether the passed DataOutput handles ClassLoader resolving. Note that the ClassLoader resolving on the "write" side is necessary only to make the stream format symetrical for the "read" side.
Parameters:
out - an object implementing DataOutput
Returns:
true if the object implementing DataOutput also implements ObjectOutput and handles ClassLoader resolving

getObjectStreamFactory

public static com.tangosol.io.ObjectStreamFactory getObjectStreamFactory()
Return the ObjectStreamFactory used to convert DataInput/Output into ObjectInput/Output streams.
Returns:
the currently used ObjectStreamFactory

setObjectStreamFactory

public static void setObjectStreamFactory(com.tangosol.io.ObjectStreamFactory factory)
Specify an ObjectStreamFactory that should be used to convert DataInput/Output into ObjectInput/Output streams.

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,

Parameters:
factory - the ObjectStreamFactory to use

isSerializable

public static boolean isSerializable(java.lang.Object o)
Determine if the resource object can be serialized using the DefaultSerializer.
Returns:
true iff the resource object can be serialized by the DefaultSerializer

getStreamFormat

protected static int getStreamFormat(java.lang.Object o)
Internal: Select an optimal stream format to use to store the passed object in a stream (as used by the DefaultSerializer).
Parameters:
o - an Object
Returns:
a stream format to use to store the object in a stream

isSerializerCompatible

public static boolean isSerializerCompatible(com.tangosol.io.Serializer serializerThis,
                                             com.tangosol.io.Serializer serializerThat)
Determines whether or not the specified serializers are compatible. In other words, this method returns true iff object serialized with the first Serializer can be deserialized by the second and visa versa.
Parameters:
serializerThis - the first Serializer
serializerThat - the second Serializer
Returns:
true iff the two Serializers are stream compatible

reportIncompatibleSerializers

public static void reportIncompatibleSerializers(com.tangosol.net.NamedCache cache,
                                                 java.lang.String sService,
                                                 com.tangosol.io.Serializer serializer)
Log the message explaining the serializer incompatibility between the specified cache and a service.
Parameters:
cache - the NamedCachce reference
sService - the service name
serializer - the serializer used by the service

isDecorated

public static boolean isDecorated(com.tangosol.io.ReadBuffer buf)
If the ReadBuffer is the result of serialization by ExternalizableHelper, determine if the buffer contains decorations.

Note: This method can only be used against ReadBuffers that result from serialization by ExternalizableHelper or buffers that are already decorated.

Parameters:
buf - the ReadBuffer to check
Returns:
true iff the ReadBuffer is decorated

isDecorated

public static boolean isDecorated(com.tangosol.io.ReadBuffer buf,
                                  int nId)
If the ReadBuffer is the result of serialization by ExternalizableHelper, determine if the buffer contains the specified decoration.

Note: This method can only be used against ReadBuffers that result from serialization by ExternalizableHelper or buffers that are already decorated.

Parameters:
buf - the ReadBuffer to check
nId - the identifier for the decoration to check
Returns:
true iff the ReadBuffer is decorated with the specified decoration

decorate

public static com.tangosol.util.Binary decorate(com.tangosol.util.Binary bin,
                                                int nId,
                                                com.tangosol.util.Binary binDecoration)
Decorate the passed value with the specified decoration and return the resulting Binary. The passed value may or may not already be decorated.

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:

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.

Parameters:
bin - the Binary to decorate, which may already be decorated
nId - the identifier for the decoration, one of the DECO_* constants
binDecoration - the decoration to apply; a null value will remove the specified decoration
Returns:
a decorated Binary containing the passed decoration

decorate

public static com.tangosol.io.ReadBuffer decorate(com.tangosol.io.ReadBuffer bufOrig,
                                                  int nId,
                                                  com.tangosol.io.ReadBuffer bufDeco)
Decorate the passed value with the specified decoration and return the resulting ReadBuffer. The passed value may or may not already be decorated.

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:

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.

Parameters:
bufOrig - the ReadBuffer to decorate, which may already be decorated
nId - the identifier for the decoration, one of the DECO_* constants
bufDeco - the decoration to apply; a null value will remove the specified decoration
Returns:
a decorated ReadBuffer containing the passed decoration

decorate

public static com.tangosol.util.Binary decorate(com.tangosol.util.Binary bin,
                                                com.tangosol.util.Binary[] abinDecorations)
Deprecated. as of Coherence 3.7.2
Decorate the passed Binary with the passed decorations. If the passed Binary is decorated, use its decorations as the defaults and the passed decorations as the overrides; if the passed Binary is not decorated, then use it as the default for the "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.

Parameters:
bin - the Binary to decorate, which may already be decorated; may be null
abinDecorations - 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 method
Returns:
a decorated Binary containing the passed decorations

decorate

public static com.tangosol.io.ReadBuffer decorate(com.tangosol.io.ReadBuffer buf,
                                                  com.tangosol.io.ReadBuffer[] abufDeco)
Decorate the passed Binary with the passed decorations. If the passed Binary is decorated, use its decorations as the defaults and the passed decorations as the overrides; if the passed Binary is not decorated, then use it as the default for the "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.

Parameters:
buf - the Binary to decorate, which may already be decorated; may be null
abufDeco - 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 method
Returns:
a decorated Binary containing the passed decorations

getDecoration

public static com.tangosol.util.Binary getDecoration(com.tangosol.util.Binary bin,
                                                     int nId)
Deprecated. as of Coherence 3.7.2
Extract and return the specified decoration from the passed Binary.

Note: This method can only be used against Binary values that result from serialization by ExternalizableHelper or Binary values that are already decorated.

Parameters:
bin - the Binary that may be decorated
nId - the identifier for the decoration
Returns:
the Binary decoration, or null if the passed Binary is not decorated or if no decoration was found for the specified identifier

getDecoration

public static com.tangosol.io.ReadBuffer getDecoration(com.tangosol.io.ReadBuffer buf,
                                                       int nId)
Extract and return the specified decoration from the passed ReadBuffer.

Note: This method can only be used against ReadBuffers that result from serialization by ExternalizableHelper or buffers that are already decorated.

Parameters:
buf - the ReadBuffer that may be decorated
nId - the identifier for the decoration
Returns:
the decoration, or null if the passed ReadBuffer is not decorated or if no decoration was found for the specified identifier

getDecorations

public static com.tangosol.io.ReadBuffer[] getDecorations(com.tangosol.io.ReadBuffer buf)
Return an array containing all of the decorations from the passed ReadBuffer.

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.

Parameters:
buf - the ReadBuffer that may be decorated
Returns:
an array of all decorations on the passed ReadBuffer, indexed by the DECO_* constants

undecorate

public static com.tangosol.util.Binary undecorate(com.tangosol.util.Binary bin,
                                                  int nId)
Deprecated. as of Coherence 3.7.2
Remove the specified decoration from the passed Binary. If the resulting Binary has no decorations remaining, then return the undecorated Binary; otherwise return the decorated Binary with the remaining decorations.

Note: This method can only be used against Binary values that result from serialization by ExternalizableHelper or Binary values that are already decorated.

Parameters:
bin - the Binary to undecorate
nId - the identifier for the decoration to remove
Returns:
a Binary that may be decorated or undecorated

undecorate

public static com.tangosol.io.ReadBuffer undecorate(com.tangosol.io.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).

Note: This method can only be used against ReadBuffers that result from serialization by ExternalizableHelper or buffers that are already decorated.

Parameters:
buf - the ReadBuffer to undecorate
nId - the identifier for the decoration to remove
Returns:
a ReadBuffer that may or may not be decorated

getUndecorated

public static com.tangosol.util.Binary getUndecorated(com.tangosol.util.Binary bin)
Deprecated. as of Coherence 3.7.2
If the passed Binary is decorated, extract the original Binary value that the decorations were added to, otherwise return the passed Binary value.

Note: This method can only be used against Binary values that result from serialization by ExternalizableHelper or Binary values that are already decorated.

Returns:
the undecorated Binary value, or null if the Binary value is decorated but does not contain an original Binary value

getUndecorated

public static com.tangosol.io.ReadBuffer getUndecorated(com.tangosol.io.ReadBuffer buf)
If the passed ReadBuffer is decorated, extract the original contents that the decorations were added to, otherwise return the passed Binary value.

Note: This method can only be used against ReadBuffers that result from serialization by ExternalizableHelper or buffers that are already decorated.

Returns:
the undecorated ReadBuffer, or null if the specified buffer is decorated but does not contain an actual value

asBinary

public static com.tangosol.util.Binary asBinary(com.tangosol.io.ReadBuffer buf)
Return a Binary representing the contents of the specified ReadBuffer, or null if the buffer is null.
Parameters:
buf - the read buffer
Returns:
the contents of the read buffer as a Binary object, or null

main

public static void main(java.lang.String[] asArgs)
Parse a hex string representing a serialized object.

Example:

   java com.tangosol.util.ExternalizableHelper 0x0603486921
 

encodeExpiry

public static com.tangosol.io.ReadBuffer encodeExpiry(com.tangosol.io.ReadBuffer buf,
                                                      long ldtExpiry)
Return a ReadBuffer whose contents represent the specified buffer with the specified expiry encoded as a DECO_EXPIRY decoration. The encoded expiry can be decoded via the decodeExpiry(com.tangosol.io.ReadBuffer) method.
Parameters:
buf - the buffer to encode
ldtExpiry - the expiry time, or CacheMap.EXPIRY_DEFAULT or CacheMap.EXPIRY_NEVER
Returns:
an expiry-encoded ReadBuffer

decodeExpiry

public static long decodeExpiry(com.tangosol.io.ReadBuffer buf)
Decode the expiry time from the specified ReadBuffer.
Parameters:
buf - the buffer to decode
Returns:
the decoded expiry, or CacheMap.EXPIRY_DEFAULT if none exists

decorate

public static ExternalizableHelper.IntDecoratedObject decorate(java.lang.Object oValue,
                                                               int nDecoration)
Decorate the specified value with the specified integer decoration.
Parameters:
oValue - the value to be decorated
nDecoration - the integer decoration
Returns:
the decorated object

decorateBinary

public static com.tangosol.io.ReadBuffer decorateBinary(com.tangosol.io.ReadBuffer bufValue,
                                                        int nDecoration)
Decorate the specified ReadBuffer with the specified integer decoration.
Parameters:
bufValue - the ReadBuffer to be decorated
nDecoration - the integer decoration
Returns:
the decorated (with integer decoration) ReadBuffer

isIntDecorated

public static boolean isIntDecorated(com.tangosol.io.ReadBuffer buf)
Check whether or not the specified ReadBuffer is a representation of an IntDecoratedObject.
Parameters:
buf - the ReadBuffer
Returns:
true iff the buffer contains (starts with) a representation of an IntDecoratedObject

extractIntDecoration

public static int extractIntDecoration(com.tangosol.io.ReadBuffer buf)
Extract a decoration value from the specified ReadBuffer that contains a representation of an IntDecoratedObject.
Parameters:
buf - the ReadBuffer
Returns:
the integer decoration value

removeIntDecoration

public static com.tangosol.util.Binary removeIntDecoration(com.tangosol.util.Binary bin)
Deprecated. as of Coherence 3.7.2
Remove a decoration value from the specified Binary that contains a representation of an IntDecoratedObject.
Parameters:
bin - the Binary object
Returns:
the undecorated Binary value

removeIntDecoration

public static com.tangosol.io.ReadBuffer removeIntDecoration(com.tangosol.io.ReadBuffer buf)
Remove a decoration value from the specified ReadBuffer that contains a representation of an IntDecoratedObject.
Parameters:
buf - the ReadBuffer
Returns:
the undecorated ReadBuffer

Skip navigation links

Oracle® Coherence Java API Reference
Release 12.1.2.0.3

E26043-02


Copyright © 2000, 2014, Oracle and/or its affiliates. All rights reserved.