|
Oracle® Fusion Middleware Java API Reference for Oracle Coherence 12c (12.1.3.0.0) E47890-01 |
|||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Object
com.tangosol.util.Base
com.tangosol.io.pof.PofHelper
com.tangosol.io.pof.PofBufferReader
public class PofBufferReader
PofReader implementation that reads POF-encoded data from a BufferInput.
| Nested Class Summary | |
|---|---|
static class |
PofBufferReader.IdentityHolder |
static class |
PofBufferReader.UserTypeReaderThe UserTypeReader implementation is a contextually-aware PofReader whose purpose is to advance through the properties of a value of a specified user type. |
| Nested classes/interfaces inherited from class com.tangosol.io.pof.PofHelper |
|---|
PofHelper.ReadableEntrySetMap, PofHelper.WriteableEntrySetMap |
| Field Summary | |
|---|---|
protected LongArray |
m_arrayRefsLazily-constructed mapping of identities to references. |
protected PofContext |
m_ctxThe PofContext to use to realize user data types as Java objects. |
protected ReadBuffer.BufferInput |
m_inThe BufferInput containing the POF stream. |
| Fields inherited from class com.tangosol.io.pof.PofHelper |
|---|
BIGDECIMAL_ZERO, BIGINTEGER_MAX_LONG, BIGINTEGER_MIN_LONG, BINARY_EMPTY, BOOLEAN_ARRAY_EMPTY, BYTE_ARRAY_EMPTY, CHAR_ARRAY_EMPTY, COLLECTION_EMPTY, DOUBLE_ARRAY_EMPTY, FLOAT_ARRAY_EMPTY, INT_ARRAY_EMPTY, LONG_ARRAY_EMPTY, OBJECT_ARRAY_EMPTY, SHORT_ARRAY_EMPTY |
| Constructor Summary | |
|---|---|
protected |
PofBufferReader() |
|
PofBufferReader(ReadBuffer.BufferInput in, PofContext ctx)Construct a new PofBufferReader that will read a POF stream from the passed BufferInput object. |
| Method Summary | |
|---|---|
protected boolean |
advanceTo(int iProp)Advance through the POF stream until the specified property is found. |
protected void |
complete(int iProp)Register the completion of the parsing of a value. |
PofReader |
createNestedPofReader(int iProp)Obtain a PofReader that can be used to read a set of properties from a single property of the current user type. |
protected LongArray |
ensureReferenceRegistry()Obtain the registry for identity-reference pairs, creating it if necessary. |
protected PofBufferReader |
getParentParser()If this parser is contextually within a user type, obtain the parser which created this parser in order to parse the user type. |
PofContext |
getPofContext()Return the PofContext object used by this PofReader to deserialize user types from a POF stream. |
int |
getUserTypeId()Determine the user type that is currently being parsed. |
int |
getVersionId()Determine the version identifier of the user type that is currently being parsed. |
protected java.lang.Object |
lookupIdentity(int nId)Look up the specified identity and return the object to which it refers. |
protected java.lang.Object |
readAsObject(int nType)Read a POF value as an Object. |
protected java.lang.Object[] |
readAsObjectArray(int nType, java.lang.Object[] ao)Read a POF value as an Object array. |
protected java.lang.Object |
readAsUniformObject(int nType)Read a POF value in a uniform array/map as an Object. |
java.math.BigDecimal |
readBigDecimal(int iProp)Read a BigDecimal from the POF stream. |
java.math.BigInteger |
readBigInteger(int iProp)Read a BigInteger from the POF stream. |
Binary |
readBinary(int iProp)Read a Binary from the POF stream. |
protected static Binary |
readBinary(ReadBuffer.BufferInput in)Read a Binary object from the specified BufferInput in an optimal way, depending on the existence of an enclosing ReadBuffer. |
boolean |
readBoolean(int iProp)Read a boolean property from the POF stream. |
boolean[] |
readBooleanArray(int iProp)Read a boolean[] property from the POF stream. |
byte |
readByte(int iProp)Read a byte property from the POF stream. |
byte[] |
readByteArray(int iProp)Read a byte[] property from the POF stream. |
char |
readChar(int iProp)Read a char property from the POF stream. |
char[] |
readCharArray(int iProp)Read a char[] property from the POF stream. |
java.util.Collection |
readCollection(int iProp, java.util.Collection coll)Read a Collection of object values from the POF stream. |
java.util.Date |
readDate(int iProp)Read a java.util.Date from the POF stream. |
double |
readDouble(int iProp)Read a double property from the POF stream. |
double[] |
readDoubleArray(int iProp)Read a double[] property from the POF stream. |
float |
readFloat(int iProp)Read a float property from the POF stream. |
float[] |
readFloatArray(int iProp)Read a float[] property from the POF stream. |
int |
readInt(int iProp)Read a int property from the POF stream. |
int[] |
readIntArray(int iProp)Read a int[] property from the POF stream. |
long |
readLong(int iProp)Read a long property from the POF stream. |
long[] |
readLongArray(int iProp)Read a long[] property from the POF stream. |
LongArray |
readLongArray(int iProp, LongArray array)Read a LongArray of object values. |
java.util.Map |
readMap(int iProp, java.util.Map map)Read a Map of key/value pairs from the POF stream. |
java.lang.Object |
readObject(int iProp)Read a property of any type, including a user type, from the POF stream. |
java.lang.Object[] |
readObjectArray(int iProp, java.lang.Object[] ao)Read an array of object values. |
RawDate |
readRawDate(int iProp)Read a RawDate from the POF stream. |
RawDateTime |
readRawDateTime(int iProp)Read a RawDateTime from the POF stream. |
RawDayTimeInterval |
readRawDayTimeInterval(int iProp)Read a RawDayTimeInterval from the POF stream. |
RawQuad |
readRawQuad(int iProp)Read a RawQuad from the POF stream. |
RawTime |
readRawTime(int iProp)Read a RawTime from the POF stream. |
RawTimeInterval |
readRawTimeInterval(int iProp)Read a RawTimeInterval from the POF stream. |
RawYearMonthInterval |
readRawYearMonthInterval(int iProp)Read a RawYearMonthInterval from the POF stream. |
Binary |
readRemainder()Read all remaining indexed properties of the current user type from the POF stream. |
short |
readShort(int iProp)Read a short property from the POF stream. |
short[] |
readShortArray(int iProp)Read a short[] property from the POF stream. |
java.lang.String |
readString(int iProp)Read a String from the POF stream. |
protected void |
registerIdentity(int nId, java.lang.Object oValue)Register the passed value with the passed identity. |
void |
registerIdentity(java.lang.Object o)Register an identity for a newly created user type instance. |
void |
setPofContext(PofContext ctx)Configure the PofContext object used by this PofReader to deserialize user types from a POF stream. |
| Field Detail |
|---|
protected ReadBuffer.BufferInput m_in
protected PofContext m_ctx
protected LongArray m_arrayRefs
| Constructor Detail |
|---|
public PofBufferReader(ReadBuffer.BufferInput in,
PofContext ctx)
in - a BufferInput objectctx - the PofContextprotected PofBufferReader()
| Method Detail |
|---|
public boolean readBoolean(int iProp)
throws java.io.IOException
readBoolean in interface PofReaderiProp - the property index to readjava.io.IOException - if an I/O error occurs
public byte readByte(int iProp)
throws java.io.IOException
readByte in interface PofReaderiProp - the property index to readjava.io.IOException - if an I/O error occurs
public char readChar(int iProp)
throws java.io.IOException
readChar in interface PofReaderiProp - the property index to readjava.io.IOException - if an I/O error occurs
public short readShort(int iProp)
throws java.io.IOException
readShort in interface PofReaderiProp - the property index to readjava.io.IOException - if an I/O error occurs
public int readInt(int iProp)
throws java.io.IOException
readInt in interface PofReaderiProp - the property index to readjava.io.IOException - if an I/O error occurs
public long readLong(int iProp)
throws java.io.IOException
readLong in interface PofReaderiProp - the property index to readjava.io.IOException - if an I/O error occurs
public float readFloat(int iProp)
throws java.io.IOException
readFloat in interface PofReaderiProp - the property index to readjava.io.IOException - if an I/O error occurs
public double readDouble(int iProp)
throws java.io.IOException
readDouble in interface PofReaderiProp - the property index to readjava.io.IOException - if an I/O error occurs
public boolean[] readBooleanArray(int iProp)
throws java.io.IOException
readBooleanArray in interface PofReaderiProp - the property index to readjava.io.IOException - if an I/O error occurs
public byte[] readByteArray(int iProp)
throws java.io.IOException
readByteArray in interface PofReaderiProp - the property index to readjava.io.IOException - if an I/O error occurs
public char[] readCharArray(int iProp)
throws java.io.IOException
readCharArray in interface PofReaderiProp - the property index to readjava.io.IOException - if an I/O error occurs
public short[] readShortArray(int iProp)
throws java.io.IOException
readShortArray in interface PofReaderiProp - the property index to readjava.io.IOException - if an I/O error occurs
public int[] readIntArray(int iProp)
throws java.io.IOException
readIntArray in interface PofReaderiProp - the property index to readjava.io.IOException - if an I/O error occurs
public long[] readLongArray(int iProp)
throws java.io.IOException
readLongArray in interface PofReaderiProp - the property index to readjava.io.IOException - if an I/O error occurs
public float[] readFloatArray(int iProp)
throws java.io.IOException
readFloatArray in interface PofReaderiProp - the property index to readjava.io.IOException - if an I/O error occurs
public double[] readDoubleArray(int iProp)
throws java.io.IOException
readDoubleArray in interface PofReaderiProp - the property index to readjava.io.IOException - if an I/O error occurs
public java.math.BigInteger readBigInteger(int iProp)
throws java.io.IOException
readBigInteger in interface PofReaderiProp - the property index to readjava.io.IOException - if an I/O error occurs
public RawQuad readRawQuad(int iProp)
throws java.io.IOException
readRawQuad in interface PofReaderiProp - the property index to readjava.io.IOException - if an I/O error occurs
public java.math.BigDecimal readBigDecimal(int iProp)
throws java.io.IOException
readBigDecimal in interface PofReaderiProp - the property index to readjava.io.IOException - if an I/O error occurs
public Binary readBinary(int iProp)
throws java.io.IOException
readBinary in interface PofReaderiProp - the property index to readjava.io.IOException - if an I/O error occurs
public java.lang.String readString(int iProp)
throws java.io.IOException
readString in interface PofReaderiProp - the property index to readjava.io.IOException - if an I/O error occurs
public java.util.Date readDate(int iProp)
throws java.io.IOException
readDate in interface PofReaderiProp - the property index to readjava.io.IOException - if an I/O error occurs
public RawDate readRawDate(int iProp)
throws java.io.IOException
RawDate class contains the raw date information that was carried in the POF stream.readRawDate in interface PofReaderiProp - the property index to readjava.io.IOException - if an I/O error occurs
public RawTime readRawTime(int iProp)
throws java.io.IOException
RawTime class contains the raw time information that was carried in the POF stream, including raw timezone information.readRawTime in interface PofReaderiProp - the property index to readjava.io.IOException - if an I/O error occurs
public RawDateTime readRawDateTime(int iProp)
throws java.io.IOException
RawDateTime class contains the raw date and time information that was carried in the POF stream, including raw timezone information.readRawDateTime in interface PofReaderiProp - the property index to readjava.io.IOException - if an I/O error occurs
public RawYearMonthInterval readRawYearMonthInterval(int iProp)
throws java.io.IOException
RawYearMonthInterval class contains the raw year-month interval information that was carried in the POF stream.readRawYearMonthInterval in interface PofReaderiProp - the property index to readjava.io.IOException - if an I/O error occurs
public RawTimeInterval readRawTimeInterval(int iProp)
throws java.io.IOException
RawTimeInterval class contains the raw time interval information that was carried in the POF stream.readRawTimeInterval in interface PofReaderiProp - the property index to readjava.io.IOException - if an I/O error occurs
public RawDayTimeInterval readRawDayTimeInterval(int iProp)
throws java.io.IOException
RawDayTimeInterval class contains the raw year-month interval information that was carried in the POF stream.readRawDayTimeInterval in interface PofReaderiProp - the property index to readjava.io.IOException - if an I/O error occurs
public java.lang.Object[] readObjectArray(int iProp,
java.lang.Object[] ao)
throws java.io.IOException
readObjectArray in interface PofReaderiProp - the property index to readao - the optional array to use to store the values, or to use as a typed template for creating an array to store the values, following the documentation for Collection.toArray()java.io.IOException - if an I/O error occurs
public LongArray readLongArray(int iProp,
LongArray array)
throws java.io.IOException
readLongArray in interface PofReaderiProp - the property index to readarray - the optional LongArray object to use to store the valuesjava.io.IOException - if an I/O error occurs
public java.util.Collection readCollection(int iProp,
java.util.Collection coll)
throws java.io.IOException
readCollection in interface PofReaderiProp - the property index to readcoll - the optional Collection to use to store the valuesjava.io.IOException - if an I/O error occurs
public java.util.Map readMap(int iProp,
java.util.Map map)
throws java.io.IOException
readMap in interface PofReaderiProp - the property index to readmap - the optional Map to initializejava.io.IOException - if an I/O error occurspublic PofContext getPofContext()
getPofContext in interface PofReaderpublic void setPofContext(PofContext ctx)
Note: this is an advanced method that should be used with care. For example, if this method is being used to switch to another PofContext mid-POF stream, it is important to eventually restore the original PofContext. For example:
PofContext ctxOrig = reader.getPofContext();
try
{
// switch to another PofContext
PofContext ctxNew = ...;
reader.setContext(ctxNew);
// read POF data using the reader
}
finally
{
// restore the original PofContext
reader.setPofContext(ctxOrig);
}
setPofContext in interface PofReaderctx - the new PofContext; must not be null
public java.lang.Object readObject(int iProp)
throws java.io.IOException
readObject in interface PofReaderiProp - the property index to readjava.io.IOException - if an I/O error occurspublic int getUserTypeId()
getUserTypeId in interface PofReaderpublic int getVersionId()
getVersionId in interface PofReaderpublic void registerIdentity(java.lang.Object o)
If identity/reference types are enabled, an identity is used to uniquely identify a user type instance within a POF stream. The identity immediately proceeds the instance value in the POF stream and can be used later in the stream to reference the instance.
PofSerializer implementations must call this method with the user type instance instantiated during deserialization prior to reading any properties of the instance which are user type instances themselves.
registerIdentity in interface PofReadero - the object to register the identity forPofSerializer.deserialize(PofReader)
public PofReader createNestedPofReader(int iProp)
throws java.io.IOException
createNestedPofReader in interface PofReaderiProp - the property index to read fromjava.io.IOException - if an I/O error occurs
public Binary readRemainder()
throws java.io.IOException
Subsequent calls to the various readXYZ methods of this interface will fail after this method is called.
readRemainder in interface PofReaderjava.io.IOException - if an I/O error occurs
protected boolean advanceTo(int iProp)
throws java.io.IOException
iProp - the index of the property to advance tojava.lang.IllegalStateException - if the POF stream has already advanced past the desired propertyjava.io.IOException - if an I/O error occurs
protected void complete(int iProp)
throws java.io.IOException
iProp - the property indexjava.io.IOException - if an I/O error occursprotected PofBufferReader getParentParser()
protected LongArray ensureReferenceRegistry()
protected void registerIdentity(int nId,
java.lang.Object oValue)
nId - the identity within the POF stream of the objectoValue - the object to associate with the passed identityjava.lang.IllegalArgumentException - if the specified identity is already registered with a different object
protected java.lang.Object lookupIdentity(int nId)
throws java.io.IOException
nId - the identityjava.io.IOException - if the requested identity is not registered
protected java.lang.Object readAsObject(int nType)
throws java.io.IOException
nType - the type identifier of the valuejava.io.IOException - if an I/O error occurs
protected java.lang.Object readAsUniformObject(int nType)
throws java.io.IOException
nType - the type identifier of the valuejava.io.IOException - if an I/O error occurs
protected java.lang.Object[] readAsObjectArray(int nType,
java.lang.Object[] ao)
throws java.io.IOException
nType - the type identifier of the valueao - the optional array to use to store the values, or to use as a typed template for creating an array to store the values, following the documentation for Collection.toArray()java.io.IOException - if an I/O error occurs
protected static Binary readBinary(ReadBuffer.BufferInput in)
throws java.io.IOException
in - a BufferInput to read fromjava.io.IOException - if an I/O error occurs
|
Oracle® Fusion Middleware Java API Reference for Oracle Coherence 12c (12.1.3.0.0) E47890-01 |
|||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||