|
CoherenceTM v3.3 Copyright© 2000-2007 by Oracle Corporation |
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectBitHelper
com.tangosol.util.ExternalizableHelper
public abstract class ExternalizableHelper
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 thetangosol.externalizable.config
system
property.
Nested Class Summary | |
---|---|
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. |
static interface |
ExternalizableHelper.XmlBeanClassCache
An interface for caching class reference by integer ID values. |
Field Summary | |
---|---|
static Converter |
CONVERTER_FROM_BINARY
Standard converter from Binary to Object format, which uses the context ClassLoader. |
static Converter |
CONVERTER_TO_BINARY
Standard converter from Object to Binary format. |
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_STORE
Decoration: The persistent state for the value. |
static int |
DECO_VALUE
Decoration: The original value (before being decorated). |
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_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_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. |
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_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. |
static String |
PROPERTY_CONFIG
The name of the system property that can be used to override the location of the ExternalizableHelper configuration file. |
static int |
STATS_THRESHOLD
Option: Size of user type objects above which sizing stats are maintained. |
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. |
Constructor Summary | |
---|---|
ExternalizableHelper()
|
Method Summary | |
---|---|
static String |
convertUTF(byte[] ab,
int of,
int cb,
char[] ach)
Convert binary UTF-8 encode data to a String. |
static Binary |
decorate(Binary bin,
Binary[] abinDecorations)
If the passed Binary is decorated, add the passed decorations and return the resulting new Binary; otherwise, create a decorated version of the passed Binary containing the passed decorations and return the resulting new Binary. |
static Binary |
decorate(Binary bin,
int nId,
Binary binDecoration)
If the passed Binary is decorated, add the passed decoration and return the resulting new Binary; otherwise, create a decorated version of the passed Binary containing the passed decoration and return the resulting new Binary. |
static ExternalizableHelper.IntDecoratedObject |
decorate(Object oValue,
int nDecoration)
Decorate the specified value with the specified integer decoration. |
static Serializer |
ensureSerializer(ClassLoader loader)
Obtain a Serializer for the specified ClassLoader. |
static int |
extractIntDecoration(ReadBuffer buffer)
Extract a decoration value from a specified ReadBuffer that contains a binary representation of an IntDecoratedObject. |
static Object |
fromBinary(Binary bin)
Read an object from a Binary object. |
static Object |
fromBinary(Binary bin,
ClassLoader loader)
Read an object from a Binary object. |
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 Binary |
getDecoration(Binary bin,
int nId)
If the passed Binary is decorated, check for and return (if it exists) the decoration for the specified identifier. |
static Binary[] |
getDecorations(Binary bin)
If the passed Binary is decorated, return an array containing all of its decorations. |
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 ObjectInput |
getObjectInput(InputStream in,
ClassLoader loader)
Get an ObjectInput for the passed InputStream object. |
static ObjectOutput |
getObjectOutput(DataOutput out)
Get an ObjectOutput for the passed DataOutput object. |
static ObjectOutput |
getObjectOutput(OutputStream out)
Get an ObjectOutput for the passed OutputStream object. |
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. |
protected static int |
getStreamFormat(Object o)
Internal: Select an optimal stream format to use to store the passed object in a stream. |
static Binary |
getUndecorated(Binary bin)
If the passed Binary is decorated, extract the original Binary value that the decorations were added to, otherwise return the passed Binary value. |
protected static WriteBuffer |
internalWriteObject(Object o,
boolean fBinary)
Serialize the passed object into a buffer created for that purpose. |
static boolean |
isClassLoaderDependent(Object o)
Determine if the resource object may depend on a specific class loader. |
static boolean |
isDecorated(Binary bin)
If the Binary is the result of serialization by ExternalizableHelper, determine if the Binary contains decorations. |
static boolean |
isIntDecorated(ReadBuffer buffer)
Check whether or not the specified ReadBuffer contains a binary representation of an IntDecoratedObject. |
static boolean |
isMarshalled(DataOutput out)
Determine whether the passed DataOutput handles marshalling of ObjectOutput. |
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 custom stream format support. |
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 serialialized 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 long |
readLong(DataInput in)
Read a long that uses variable length storage in the stream. |
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 Object |
readObject(DataInput in)
Read an Object from the passed DataInput object. |
static Object |
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 Serializable |
readSerializable(DataInput in)
Read a Serializable object from a DataInput stream. |
static Serializable |
readSerializable(DataInput in,
ClassLoader loader)
Read a Serializable 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 ClassLoader |
resolveLoader(ClassLoader loader)
Return the passed ClassLoader if one is passed; otherwise return the ContextClassLoader. |
static Binary |
toBinary(Object o)
Write an object into a Binary object. |
static byte[] |
toByteArray(Object o)
Write an object to a byte array. |
static long |
translateTrint(int nTrint,
long lCurrent)
Convert a three-byte unsigned integer ("trint") to a long value. |
static Binary |
undecorate(Binary bin,
int nId)
If the passed Binary is decorated, check for a decoration with the passed identify and remove it. |
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 |
writeLong(DataOutput out,
long l)
Write a long to a stream 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 |
writeSerializable(DataOutput out,
Serializable o)
Write a Serializable 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. |
Field Detail |
---|
protected static final int FMT_NONE
protected static final int FMT_NULL
protected static final int FMT_INT
protected static final int FMT_LONG
protected static final int FMT_DOUBLE
protected static final int FMT_INTEGER
protected static final int FMT_DECIMAL
protected static final int FMT_STRING
protected static final int FMT_BINARY
protected static final int FMT_B_ARRAY
protected static final int FMT_XML_SER
protected static final int FMT_OBJ_EXT
protected static final int FMT_OBJ_SER
protected static final int FMT_XML_BEAN
protected static final int FMT_IDO
protected static final int FMT_FLOAT
protected static final int FMT_SHORT
protected static final int FMT_BYTE
protected static final int FMT_BOOLEAN
protected static final int FMT_BIN_DECO
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_CUSTOM
public static final int TRINT_DOMAIN_SPAN
public static final int TRINT_MAX_VALUE
public static final int TRINT_MAX_VARIANCE
public static final Converter CONVERTER_TO_BINARY
public static final Converter CONVERTER_FROM_BINARY
Base.getContextClassLoader()
public static final String PROPERTY_CONFIG
public static final boolean FORCE_RESOLVING_STREAMS
public static final boolean USE_MARSHAL_STREAMS
public static final boolean USE_XMLBEAN_CLASS_CACHE
public static final ExternalizableHelper.XmlBeanClassCache XMLBEAN_CLASS_CACHE
public static final int STATS_THRESHOLD
public static final boolean USE_POF_STREAMS
Constructor Detail |
---|
public ExternalizableHelper()
Method Detail |
---|
public static byte[] toByteArray(Object o)
o
- the object to write into a byte array
WrapperException
- may contain an IOExceptionpublic static Object fromByteArray(byte[] ab)
ab
- the byte array containing the object
WrapperException
- may contain an IOExceptionpublic static Object fromByteArray(byte[] ab, ClassLoader loader)
ab
- the byte array containing the objectloader
- the ClassLoader to use
WrapperException
- may contain an IOExceptionpublic static Binary toBinary(Object o)
o
- the object to write into a Binary object
WrapperException
- may contain an IOExceptionpublic static Object fromBinary(Binary bin)
bin
- the Binary object containing the serialized object
WrapperException
- may contain an IOExceptionpublic static Object fromBinary(Binary bin, ClassLoader loader)
bin
- the Binary object containing the serialized objectloader
- the ClassLoader to use
WrapperException
- may contain an IOExceptionpublic static Serializer ensureSerializer(ClassLoader loader)
loader
- a ClassLoader
public static int readTrint(DataInput in) throws IOException
in
- DataInput stream to read from
IOException
public static int readUnsignedTrint(DataInput in) throws IOException
in
- DataInput stream to read from
IOException
public static void writeTrint(DataOutput out, int n) throws IOException
out
- DataOutput stream to write ton
- a three-byte integer value passed as an int
IOException
public static void writeTrint(DataOutput out, long l) throws IOException
out
- DataOutput stream to write tol
- a three-byte integer value passed as an long
IOException
public static int makeTrint(long l)
l
- the long value to convert to a trint
public static long translateTrint(int nTrint, long lCurrent)
nTrint
- the unsigned 3-byte integer value (a "trint")lCurrent
- the signed 8-byte integer value that the trint will be
translated based on ("close to")
public static int readInt(DataInput in) throws IOException
in
- a DataInput stream to read from
IOException
- 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 write
IOException
- if an I/O exception occurspublic static long readLong(DataInput in) throws IOException
in
- a DataInput stream to read from
IOException
- 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 write
IOException
- if an I/O exception occurspublic static boolean[] readBooleanArray(DataInput in) throws IOException
in
- a DataInput stream to read from
IOException
- 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 write
IOException
- if an I/O exception occurs
NullPointerException
- if null value if passedpublic static byte[] readByteArray(DataInput in) throws IOException
in
- a DataInput stream to read from
IOException
- 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 write
IOException
- if an I/O exception occurs
NullPointerException
- 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 from
IOException
- 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 into
UTFDataFormatException
- 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 write
IOException
- if an I/O exception occurs
NullPointerException
- if null value if passedpublic 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 from
IOException
- if an I/O exception occurspublic 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 from
IOException
- 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 write
IOException
- if an I/O exception occurs
NullPointerException
- if null value if passedpublic static BigInteger readBigInteger(DataInput in) throws IOException
in
- a DataInput stream to read from
IOException
- 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 write
IOException
- if an I/O exception occurs
NullPointerException
- if null value if passedpublic static BigDecimal readBigDecimal(DataInput in) throws IOException
in
- a DataInput stream to read from
IOException
- 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 write
IOException
- if an I/O exception occurs
NullPointerException
- if null value if passedpublic static Date readDate(DataInput in) throws IOException
in
- a DataInput stream to read from
IOException
- 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 write
IOException
- if an I/O exception occurs
NullPointerException
- if null value if passedpublic static Time readTime(DataInput in) throws IOException
in
- a DataInput stream to read from
IOException
- 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 write
IOException
- if an I/O exception occurs
NullPointerException
- if null value if passedpublic static Timestamp readTimestamp(DataInput in) throws IOException
in
- a DataInput stream to read from
IOException
- 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 write
IOException
- if an I/O exception occurs
NullPointerException
- if null value if passedpublic static float[] readFloatArray(DataInput in) throws IOException
in
- a DataInput stream to read from
IOException
- 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 write
IOException
- if an I/O exception occurs
NullPointerException
- if null value if passedpublic static double[] readDoubleArray(DataInput in) throws IOException
in
- a DataInput stream to read from
IOException
- 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 write
IOException
- if an I/O exception occurs
NullPointerException
- 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 use
IOException
- 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 use
IOException
- 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 write
IOException
- 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 use
IOException
- 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 write
IOException
- if an I/O exception occurspublic static XmlSerializable readXmlSerializable(DataInput in) throws IOException
in
- a DataInput stream to read from
IOException
- 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 use
IOException
- 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 write
IOException
- if an I/O exception occurs
NullPointerException
- if null value if passedpublic static ExternalizableLite readExternalizableLite(DataInput in) throws IOException
in
- a DataInput stream to read from
IOException
- 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 use
IOException
- 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 write
IOException
- if an I/O exception occurs
NullPointerException
- if null value if passedpublic static XmlBean readXmlBean(DataInput in, ClassLoader loader) throws IOException
in
- a DataInput stream to read fromloader
- the ClassLoader to use
IOException
- 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 write
IOException
- if an I/O exception occurs
NullPointerException
- if null value if passedpublic static Serializable readSerializable(DataInput in) throws IOException
in
- a DataInput stream to read from
IOException
- if an I/O exception occurspublic static Serializable readSerializable(DataInput in, ClassLoader loader) throws IOException
in
- a DataInput stream to read fromloader
- the ClassLoader to use
IOException
- if an I/O exception occurspublic static void writeSerializable(DataOutput out, Serializable o) throws IOException
out
- a DataOutput stream to write too
- a Serializable value to write
IOException
- if an I/O exception occurspublic static Object readObject(DataInput in) throws IOException
in
- the DataInput stream to read an object from
IOException
- if an I/O exception occurspublic static Object readObject(DataInput in, ClassLoader loader) throws IOException
in
- the DataInput stream to read an object fromloader
- the ClassLoader to use
IOException
- 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 null
IOException
- if an I/O exception occursprotected static WriteBuffer internalWriteObject(Object o, boolean fBinary) throws IOException
o
- the object to writefBinary
- pass true to prefer a buffer type that is optimized for
producing a Binary result
IOException
- if an I/O exception occurspublic static Class loadClass(String sClass, ClassLoader loader1, ClassLoader loader2) throws ClassNotFoundException
sClass
- the class nameloader1
- first ClassLoader to tryloader2
- second ClassLoader to try
ClassNotFoundException
- 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 try
public static InputStream getInputStream(DataInput in)
in
- an Object implementing the DataInput interface
public static OutputStream getOutputStream(DataOutput out)
out
- an Object implementing the DataOutput interface
public static OutputStream getShieldedOutputStream(OutputStream out)
out
- an OutputStream
public static ObjectInput getObjectInput(InputStream in, ClassLoader loader) throws IOException
in
- an InputStreamloader
- the ClassLoader to use
IOException
public static ObjectInput getObjectInput(DataInput in, ClassLoader loader) throws IOException
in
- an Object implementing the DataInput interfaceloader
- the ClassLoader to use
IOException
public static ObjectInput getNewObjectInput(DataInput in, ClassLoader loader) throws IOException
in
- an Object implementing the DataInput interfaceloader
- the ClassLoader to use
in
IOException
public static ClassLoader resolveLoader(ClassLoader loader)
loader
- a ClassLoader or null
public static ObjectOutput getObjectOutput(OutputStream out) throws IOException
out
- an OutputStream
IOException
public static ObjectOutput getObjectOutput(DataOutput out) throws IOException
out
- an Object implementing the DataOutput interface
IOException
public static boolean isMarshalled(DataOutput out)
out
- an object implementing DataOutput
public static boolean isResolving(DataOutput out)
out
- an object implementing DataOutput
public static boolean isSerializable(Object o)
public static boolean isClassLoaderDependent(Object o)
protected static int getStreamFormat(Object o)
o
- an Object
public static boolean isDecorated(Binary bin)
bin
- the Binary to check
public static Binary decorate(Binary bin, int nId, Binary binDecoration)
bin
- the Binary to decoratenId
- the identifier for the decorationbinDecoration
- the decoration to apply
public static Binary decorate(Binary bin, Binary[] abinDecorations)
bin
- the Binary to decorate; 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
public static Binary getDecoration(Binary bin, int nId)
bin
- the Binary that may be decoratednId
- the identifier for the decoration
public static Binary[] getDecorations(Binary bin)
bin
- the Binary that may be decorated
public static Binary undecorate(Binary bin, int nId)
nId
- the identifier for the decoration to remove
public static Binary getUndecorated(Binary bin)
public static void main(String[] asArgs)
Example:
java com.tangosol.util.ExternalizableHelper 0x0603486921
public static ExternalizableHelper.IntDecoratedObject decorate(Object oValue, int nDecoration)
oValue
- the value to be decoratednDecoration
- the integer decoration
public static boolean isIntDecorated(ReadBuffer buffer)
buffer
- the ReadBuffer containing some binary data
public static int extractIntDecoration(ReadBuffer buffer)
buffer
- the ReadBuffer containing some binary data
|
CoherenceTM v3.3 Copyright© 2000-2007 by Oracle Corporation |
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |