Class PofBufferWriter
- java.lang.Object
-
- com.tangosol.util.Base
-
- com.tangosol.io.pof.PofHelper
-
- com.tangosol.io.pof.PofBufferWriter
-
- All Implemented Interfaces:
PofConstants,PofWriter
- Direct Known Subclasses:
PofBufferWriter.UserTypeWriter
public class PofBufferWriter extends PofHelper implements PofWriter
PofWriterimplementation that writes POF-encoded data to aBufferOutput.- Since:
- Coherence 3.2
- Author:
- jh 2006.07.11
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classPofBufferWriter.ReferenceLibraryA "library" of object references and their corresponding identities in the POF stream.static classPofBufferWriter.UserTypeWriterThe UserTypeWriter implementation is a contextually-aware PofWriter whose purpose is to write 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
-
Nested classes/interfaces inherited from class com.tangosol.util.Base
Base.LoggingWriter
-
-
Field Summary
Fields Modifier and Type Field Description protected PofContextm_ctxThe PofContext used by this PofBufferWriter to serialize user types.protected booleanm_fEvolvableIndicate if the object to be written is either Evolvable or part of an Evolvable object.protected WritingPofHandlerm_handlerThe WritingPofHandler used to write a POF stream.protected WriteBuffer.BufferOutputm_outThe BufferOutput object that the PofBufferWriter writes to.protected PofBufferWriter.ReferenceLibrarym_refsIf references are used, then this is the ReferenceLibrary.-
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
-
Fields inherited from class com.tangosol.util.Base
DEFAULT_LOAD_FACTOR, LOG_ALWAYS, LOG_CONFIG, 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
-
Fields inherited from interface com.tangosol.io.pof.PofConstants
J_BIG_DECIMAL, J_BIG_INTEGER, J_BINARY, J_BOOLEAN, J_BOOLEAN_ARRAY, J_BYTE, J_BYTE_ARRAY, J_CHAR_ARRAY, J_CHARACTER, J_COLLECTION, J_DATE, J_DATETIME, J_DOUBLE, J_DOUBLE_ARRAY, J_FLOAT, J_FLOAT_ARRAY, J_INT_ARRAY, J_INTEGER, J_LOCAL_DATE, J_LOCAL_DATETIME, J_LOCAL_TIME, J_LONG, J_LONG_ARRAY, J_MAP, J_NULL, J_OBJECT_ARRAY, J_OFFSET_DATETIME, J_OFFSET_TIME, J_QUAD, J_RAW_DATE, J_RAW_DATETIME, J_RAW_DAY_TIME_INTERVAL, J_RAW_TIME, J_RAW_TIME_INTERVAL, J_RAW_YEAR_MONTH_INTERVAL, J_SHORT, J_SHORT_ARRAY, J_SPARSE_ARRAY, J_STRING, J_TIME, J_TIMESTAMP, J_USER_TYPE, J_ZONED_DATETIME, MAX_DECIMAL128_SCALE, MAX_DECIMAL128_UNSCALED, MAX_DECIMAL32_SCALE, MAX_DECIMAL32_UNSCALED, MAX_DECIMAL64_SCALE, MAX_DECIMAL64_UNSCALED, MIN_DECIMAL128_SCALE, MIN_DECIMAL32_SCALE, MIN_DECIMAL64_SCALE, T_ARRAY, T_BOOLEAN, T_CHAR, T_CHAR_STRING, T_COLLECTION, T_DATE, T_DATETIME, T_DAY_TIME_INTERVAL, T_DECIMAL128, T_DECIMAL32, T_DECIMAL64, T_FLOAT128, T_FLOAT32, T_FLOAT64, T_IDENTITY, T_INT128, T_INT16, T_INT32, T_INT64, T_MAP, T_OCTET, T_OCTET_STRING, T_REFERENCE, T_SPARSE_ARRAY, T_TIME, T_TIME_INTERVAL, T_UNIFORM_ARRAY, T_UNIFORM_COLLECTION, T_UNIFORM_KEYS_MAP, T_UNIFORM_MAP, T_UNIFORM_SPARSE_ARRAY, T_UNKNOWN, T_YEAR_MONTH_INTERVAL, V_BOOLEAN_FALSE, V_BOOLEAN_TRUE, V_COLLECTION_EMPTY, V_FP_NAN, V_FP_NEG_INFINITY, V_FP_POS_INFINITY, V_INT_0, V_INT_1, V_INT_10, V_INT_11, V_INT_12, V_INT_13, V_INT_14, V_INT_15, V_INT_16, V_INT_17, V_INT_18, V_INT_19, V_INT_2, V_INT_20, V_INT_21, V_INT_22, V_INT_3, V_INT_4, V_INT_5, V_INT_6, V_INT_7, V_INT_8, V_INT_9, V_INT_NEG_1, V_REFERENCE_NULL, V_STRING_ZERO_LENGTH
-
-
Constructor Summary
Constructors Constructor Description PofBufferWriter(WritingPofHandler handler, PofContext ctx)Construct a new PofBufferWriter that will write a POF stream using the passed WritingPofHandler.PofBufferWriter(WriteBuffer.BufferOutput out, PofContext ctx)Construct a new PofBufferWriter that will write a POF stream to the passed BufferOutput object.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected static voidassertEqual(Class clz, Class clzTest)Assert that a class is equal to another class.protected voidbeginProperty(int iProp)Report that a POF property is about to be written to the POF stream.PofWritercreateNestedPofWriter(int iProp)Obtain a PofWriter that can be used to write a set of properties into a single property of the current user type.PofWritercreateNestedPofWriter(int iProp, int nTypeId)Obtain a PofWriter that can be used to write a set of properties into a single property of the current user type.voidenableReference()Ensure that reference support (necessary for cyclic dependencies) is enabled.protected voidendProperty(int iProp)Signifies the termination of the current POF property.protected static DatefixNanos(Date dt)Return aDatewhich is suitable for POF serializationprotected WriteBuffer.BufferOutputgetBufferOutput()Return the BufferOutput that this PofBufferWriter writes to.protected static intgetNanos(Date dt)Extract the nanoseconds from the date.protected PofBufferWritergetParentWriter()If this writer is contextually within a user type, obtain the writer which created this writer in order to write the user type.PofContextgetPofContext()Return the PofContext object used by this PofWriter to serialize user types to a POF stream.protected WritingPofHandlergetPofHandler()Return the WritingPofHandler used internally by this PofBufferWriter to write the POF stream.intgetUserTypeId()Determine the user type that is currently being written.intgetVersionId()Determine the version identifier of the user type that is currently being written.protected booleanisEvolvable()Determine if the object to be written is either Evolvable or part of an Evolvable object.booleanisReferenceEnabled()Determine if reference support is enabled.static voidmain(String[] args)protected voidonException(Exception e)Called when an unexpected exception is caught while writing to the POF stream.protected voidsetEvolvable(boolean fEvolvable)Set the Evolvable flag to indicate if the object to be written is Evolvable or part of an Evolvable object.voidsetPofContext(PofContext ctx)Configure the PofContext object used by this PofWriter to serialize user types to a POF stream.voidsetVersionId(int nVersionId)Set the version identifier of the user type that is currently being written.voidwriteBigDecimal(int iProp, BigDecimal dec)Write a BigDecimal property to the POF stream.voidwriteBigInteger(int iProp, BigInteger n)Write a BigInteger property to the POF stream.voidwriteBinary(int iProp, Binary bin)Write aBinaryproperty to the POF stream.voidwriteBoolean(int iProp, boolean f)Write a boolean property to the POF stream.protected voidwriteBoolean(int iProp, boolean f, boolean fReferenceable)Write a boolean property to the POF stream.voidwriteBooleanArray(int iProp, boolean[] af)Write a boolean[] property to the POF stream.voidwriteByte(int iProp, byte b)Write a byte property to the POF stream.protected voidwriteByte(int iProp, byte b, boolean fReferenceable)Write a byte property to the POF stream.voidwriteByteArray(int iProp, byte[] ab)Write a byte[] property to the POF stream.voidwriteChar(int iProp, char ch)Write a char property to the POF stream.protected voidwriteChar(int iProp, char ch, boolean fReferenceable)Write a char property to the POF stream.voidwriteCharArray(int iProp, char[] ach)Write a char[] property to the POF stream.<T> voidwriteCollection(int iProp, Collection<? extends T> coll)Write a Collection property to the POF stream.<T> voidwriteCollection(int iProp, Collection<? extends T> coll, Class<? extends T> clz)Write a uniform Collection property to the POF stream.voidwriteDate(int iProp, LocalDate dt)Write a LocalDate property to the POF stream in ISO8601 format.voidwriteDate(int iProp, Date dt)Write a Date property to the POF stream in ISO8601 format.voidwriteDateTime(int iProp, Timestamp dt)Write a Timestamp property to the POF stream in ISO8601 format.voidwriteDateTime(int iProp, LocalDateTime dt)Write a LocalDateTime property to the POF stream in ISO8601 format.voidwriteDateTime(int iProp, Date dt)Write a Date property to the POF stream in ISO8601 format.voidwriteDateTimeWithZone(int iProp, Timestamp dt)Write a Timestamp property to the POF stream in ISO8601 format.voidwriteDateTimeWithZone(int iProp, OffsetDateTime dt)Write a OffsetDateTime property to the POF stream in ISO8601 format.voidwriteDateTimeWithZone(int iProp, Date dt)Write a Date property to the POF stream in ISO8601 format.voidwriteDouble(int iProp, double dfl)Write a double property to the POF stream.protected voidwriteDouble(int iProp, double dfl, boolean fReferenceable)Write a double property to the POF stream.voidwriteDoubleArray(int iProp, double[] adfl)Write a double[] property to the POF stream.voidwriteFloat(int iProp, float fl)Write a float property to the POF stream.protected voidwriteFloat(int iProp, float fl, boolean fReferenceable)Write a float property to the POF stream.voidwriteFloatArray(int iProp, float[] afl)Write a float[] property to the POF stream.voidwriteInt(int iProp, int n)Write a int property to the POF stream.protected voidwriteInt(int iProp, int n, boolean fReferenceable)Write a int property to the POF stream.voidwriteIntArray(int iProp, int[] an)Write a int[] property to the POF stream.voidwriteLong(int iProp, long n)Write a long property to the POF stream.protected voidwriteLong(int iProp, long n, boolean fReferenceable)Write a long property to the POF stream.voidwriteLongArray(int iProp, long[] an)Write a long[] property to the POF stream.voidwriteLongArray(int iProp, LongArray la)Write a LongArray property to the POF stream.voidwriteLongArray(int iProp, LongArray la, Class clz)Write a uniform LongArray property to the POF stream.<K,V>
voidwriteMap(int iProp, Map<? extends K,? extends V> map)Write a Map property to the POF stream.<K,V>
voidwriteMap(int iProp, Map<K,? extends V> map, Class<? extends K> clzKey)Write a uniform key Map property to the POF stream.<K,V>
voidwriteMap(int iProp, Map<K,V> map, Class<? extends K> clzKey, Class<? extends V> clzValue)Write a uniform Map property to the POF stream.voidwriteObject(int iProp, Object o)Write an Object property to the POF stream.<T> voidwriteObjectArray(int iProp, T[] ao)Write an Object[] property to the POF stream.<T> voidwriteObjectArray(int iProp, T[] ao, Class<? extends T> clz)Write a uniform Object[] property to the POF stream.<T> voidwriteOptional(int iProp, Optional<T> o)voidwriteOptionalDouble(int iProp, OptionalDouble n)voidwriteOptionalInt(int iProp, OptionalInt n)voidwriteOptionalLong(int iProp, OptionalLong n)voidwriteRawDate(int iProp, RawDate date)Write a RawDate property to the POF stream.voidwriteRawDateTime(int iProp, RawDateTime dt)Write a RawDateTime property to the POF stream.voidwriteRawDayTimeInterval(int iProp, RawDayTimeInterval interval)Write a RawDayTimeInterval property to the POF stream.voidwriteRawQuad(int iProp, RawQuad qfl)Write a RawQuad property to the POF stream.voidwriteRawTime(int iProp, RawTime time)Write a RawTime property to the POF stream.voidwriteRawTimeInterval(int iProp, RawTimeInterval interval)Write a RawTimeInterval property to the POF stream.voidwriteRawYearMonthInterval(int iProp, RawYearMonthInterval interval)Write a RawYearMonthInterval property to the POF stream.voidwriteRemainder(Binary binProps)Write the remaining properties to the POF stream, terminating the writing of the current user type.voidwriteShort(int iProp, short n)Write a short property to the POF stream.protected voidwriteShort(int iProp, short n, boolean fReferenceable)Write a short property to the POF stream.voidwriteShortArray(int iProp, short[] an)Write a short[] property to the POF stream.voidwriteString(int iProp, String s)Write a String property to the POF stream.voidwriteTime(int iProp, Timestamp dt)Write a Timestamp property to the POF stream in ISO8601 format.voidwriteTime(int iProp, LocalTime dt)Write a LocalTime property to the POF stream in ISO8601 format.voidwriteTime(int iProp, Date dt)Write a Date property to the POF stream in ISO8601 format.voidwriteTimeWithZone(int iProp, Timestamp dt)Write a Timestamp property to the POF stream in ISO8601 format.voidwriteTimeWithZone(int iProp, OffsetTime dt)Write a OffsetTime property to the POF stream in ISO8601 format.voidwriteTimeWithZone(int iProp, Date dt)Write a Date property to the POF stream in ISO8601 format.protected voidwriteUserType(int iProp, Object o)Write a user-type to the POF stream.-
Methods inherited from class com.tangosol.io.pof.PofHelper
calcDecimalSize, checkDate, checkDayTimeInterval, checkDecimalRange, checkElementCount, checkReferenceRange, checkTime, checkTimeInterval, checkTimeZone, checkType, checkYearMonthInterval, convertNumber, convertToDate, decodeTinyInt, encodeTinyInt, formatDate, formatTime, formatTime, getJavaTypeId, getPofTypeId, isIntrinsicPofType, readAsBigDecimal, readAsBigInteger, readAsChar, readAsDouble, readAsFloat, readAsInt, readAsLong, readAsQuad, readBigDecimal, readBigInteger, readChar, readLocalDate, readLocalDateTime, readLocalTime, readOffsetDateTime, readOffsetTime, readQuad, readRawDate, readRawTime, resizeArray, skipPackedInts, skipUniformValue, skipValue, writeBigDecimal, writeBigInteger, writeDate, writeTime
-
Methods inherited from class com.tangosol.util.Base
azzert, azzert, azzert, azzertFailed, breakLines, breakLines, capitalize, checkNotEmpty, checkNotNull, checkRange, computeSafeWaitTime, decimalValue, dup, dup, ensureBigDecimal, ensureClassLoader, ensureRuntimeException, ensureRuntimeException, equals, equalsDeep, err, err, err, err, err, escape, formatDateTime, getCallerStackFrame, getCommonMonitor, getCommonMonitor, getCommonMonitor, getContextClassLoader, getContextClassLoader, getDeepMessage, getErr, getLastSafeTimeMillis, getLog, getMaxDecDigits, getMaxHexDigits, getOriginalException, getOut, getProcessRandom, getRandom, getRandomBinary, getRandomBinary, getRandomString, getSafeTimeMillis, getStackFrame, getStackFrames, getStackTrace, getStackTrace, getStackTrace, getThreadFactory, getTimeZone, getUpTimeMillis, hashCode, hexValue, indentString, indentString, isDecimal, isHex, isLogEcho, isOctal, log, log, log, log, log, makeInteger, makeLong, makeThread, mergeArray, mergeBooleanArray, mergeByteArray, mergeCharArray, mergeDoubleArray, mergeFloatArray, mergeIntArray, mergeLongArray, mod, mod, newHashMap, newHashMap, newHashSet, newHashSet, octalValue, out, out, out, out, out, pad, parseBandwidth, parseBandwidth, parseDelimitedString, parseHex, parseHex, parseMemorySize, parseMemorySize, parsePercentage, parseTime, parseTime, parseTimeNanos, parseTimeNanos, printStackTrace, randomize, randomize, randomize, randomize, read, read, read, read, read, read, read, replace, setErr, setLog, setLogEcho, setOut, sleep, toBandwidthString, toBandwidthString, toCharEscape, toCrc, toCrc, toCrc, toCrc, toCrc, toDecString, toDelimitedString, toDelimitedString, toDelimitedString, toDelimitedString, toHex, toHex, toHexDump, toHexEscape, toHexEscape, toHexEscape, toHexEscape, toHexString, toMemorySizeString, toMemorySizeString, toQuotedCharEscape, toQuotedStringEscape, toSqlString, toString, toString, toStringEscape, toUnicodeEscape, trace, trace, trace, trace, trace, trace, trace, trace, trace, truncateString, truncateString, wait
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.tangosol.io.pof.PofWriter
writeDateTimeWithZone
-
-
-
-
Field Detail
-
m_out
protected WriteBuffer.BufferOutput m_out
The BufferOutput object that the PofBufferWriter writes to.
-
m_ctx
protected PofContext m_ctx
The PofContext used by this PofBufferWriter to serialize user types.
-
m_fEvolvable
protected boolean m_fEvolvable
Indicate if the object to be written is either Evolvable or part of an Evolvable object.
-
m_handler
protected WritingPofHandler m_handler
The WritingPofHandler used to write a POF stream.
-
m_refs
protected PofBufferWriter.ReferenceLibrary m_refs
If references are used, then this is the ReferenceLibrary.
-
-
Constructor Detail
-
PofBufferWriter
public PofBufferWriter(WriteBuffer.BufferOutput out, PofContext ctx)
Construct a new PofBufferWriter that will write a POF stream to the passed BufferOutput object.- Parameters:
out- the BufferOutput object to write to; must not be nullctx- the PofContext used by the new PofBufferWriter to serialize user types; must not be null
-
PofBufferWriter
public PofBufferWriter(WritingPofHandler handler, PofContext ctx)
Construct a new PofBufferWriter that will write a POF stream using the passed WritingPofHandler.- Parameters:
handler- the WritingPofHandler used for writing; must not be nullctx- the PofContext used by the new PofBufferWriter to serialize user types; must not be null
-
-
Method Detail
-
writeBoolean
public void writeBoolean(int iProp, boolean f) throws IOExceptionWrite a boolean property to the POF stream.- Specified by:
writeBooleanin interfacePofWriter- Parameters:
iProp- the property indexf- the boolean property value to write- Throws:
IOException- if an I/O error occurs
-
writeBoolean
protected void writeBoolean(int iProp, boolean f, boolean fReferenceable) throws IOExceptionWrite a boolean property to the POF stream.- Parameters:
iProp- the property indexf- the boolean property value to writefReferenceable- true if the property value is a referenceable type- Throws:
IllegalArgumentException- if the property index is invalid, or is less than or equal to the index of the previous property written to the POF streamIOException- if an I/O error occurs
-
writeByte
public void writeByte(int iProp, byte b) throws IOExceptionWrite a byte property to the POF stream.- Specified by:
writeBytein interfacePofWriter- Parameters:
iProp- the property indexb- the byte property value to write- Throws:
IOException- if an I/O error occurs
-
writeByte
protected void writeByte(int iProp, byte b, boolean fReferenceable) throws IOExceptionWrite a byte property to the POF stream.- Parameters:
iProp- the property indexb- the byte property value to writefReferenceable- true if the property value is a referenceable type- Throws:
IllegalArgumentException- if the property index is invalid, or is less than or equal to the index of the previous property written to the POF streamIOException- if an I/O error occurs
-
writeChar
public void writeChar(int iProp, char ch) throws IOExceptionWrite a char property to the POF stream.- Specified by:
writeCharin interfacePofWriter- Parameters:
iProp- the property indexch- the char property value to write- Throws:
IOException- if an I/O error occurs
-
writeChar
protected void writeChar(int iProp, char ch, boolean fReferenceable) throws IOExceptionWrite a char property to the POF stream.- Parameters:
iProp- the property indexch- the char property value to writefReferenceable- true if the property value is a referenceable type- Throws:
IllegalArgumentException- if the property index is invalid, or is less than or equal to the index of the previous property written to the POF streamIOException- if an I/O error occurs
-
writeShort
public void writeShort(int iProp, short n) throws IOExceptionWrite a short property to the POF stream.- Specified by:
writeShortin interfacePofWriter- Parameters:
iProp- the property indexn- the short property value to write- Throws:
IOException- if an I/O error occurs
-
writeShort
protected void writeShort(int iProp, short n, boolean fReferenceable) throws IOExceptionWrite a short property to the POF stream.- Parameters:
iProp- the property indexn- the short property value to writefReferenceable- true if the property value is a referenceable type- Throws:
IllegalArgumentException- if the property index is invalid, or is less than or equal to the index of the previous property written to the POF streamIOException- if an I/O error occurs
-
writeInt
public void writeInt(int iProp, int n) throws IOExceptionWrite a int property to the POF stream.- Specified by:
writeIntin interfacePofWriter- Parameters:
iProp- the property indexn- the int property value to write- Throws:
IOException- if an I/O error occurs
-
writeInt
protected void writeInt(int iProp, int n, boolean fReferenceable) throws IOExceptionWrite a int property to the POF stream.- Parameters:
iProp- the property indexn- the int property value to writefReferenceable- true if the property value is a referenceable type- Throws:
IllegalArgumentException- if the property index is invalid, or is less than or equal to the index of the previous property written to the POF streamIOException- if an I/O error occurs
-
writeLong
public void writeLong(int iProp, long n) throws IOExceptionWrite a long property to the POF stream.- Specified by:
writeLongin interfacePofWriter- Parameters:
iProp- the property indexn- the long property value to write- Throws:
IOException- if an I/O error occurs
-
writeLong
protected void writeLong(int iProp, long n, boolean fReferenceable) throws IOExceptionWrite a long property to the POF stream.- Parameters:
iProp- the property indexn- the long property value to writefReferenceable- true if the property value is a referenceable type- Throws:
IllegalArgumentException- if the property index is invalid, or is less than or equal to the index of the previous property written to the POF streamIOException- if an I/O error occurs
-
writeFloat
public void writeFloat(int iProp, float fl) throws IOExceptionWrite a float property to the POF stream.- Specified by:
writeFloatin interfacePofWriter- Parameters:
iProp- the property indexfl- the float property value to write- Throws:
IOException- if an I/O error occurs
-
writeFloat
protected void writeFloat(int iProp, float fl, boolean fReferenceable) throws IOExceptionWrite a float property to the POF stream.- Parameters:
iProp- the property indexfl- the float property value to writefReferenceable- true if the property value is a referenceable type- Throws:
IllegalArgumentException- if the property index is invalid, or is less than or equal to the index of the previous property written to the POF streamIOException- if an I/O error occurs
-
writeDouble
public void writeDouble(int iProp, double dfl) throws IOExceptionWrite a double property to the POF stream.- Specified by:
writeDoublein interfacePofWriter- Parameters:
iProp- the property indexdfl- the double property value to write- Throws:
IOException- if an I/O error occurs
-
writeDouble
protected void writeDouble(int iProp, double dfl, boolean fReferenceable) throws IOExceptionWrite a double property to the POF stream.- Parameters:
iProp- the property indexdfl- the double property value to writefReferenceable- true if the property value is a referenceable type- Throws:
IllegalArgumentException- if the property index is invalid, or is less than or equal to the index of the previous property written to the POF streamIOException- if an I/O error occurs
-
writeBooleanArray
public void writeBooleanArray(int iProp, boolean[] af) throws IOExceptionWrite a boolean[] property to the POF stream.- Specified by:
writeBooleanArrayin interfacePofWriter- Parameters:
iProp- the property indexaf- the boolean[] property value to write- Throws:
IOException- if an I/O error occurs
-
writeByteArray
public void writeByteArray(int iProp, byte[] ab) throws IOExceptionWrite a byte[] property to the POF stream.- Specified by:
writeByteArrayin interfacePofWriter- Parameters:
iProp- the property indexab- the byte[] property value to write- Throws:
IOException- if an I/O error occurs
-
writeCharArray
public void writeCharArray(int iProp, char[] ach) throws IOExceptionWrite a char[] property to the POF stream.- Specified by:
writeCharArrayin interfacePofWriter- Parameters:
iProp- the property indexach- the char[] property value to write- Throws:
IOException- if an I/O error occurs
-
writeShortArray
public void writeShortArray(int iProp, short[] an) throws IOExceptionWrite a short[] property to the POF stream.- Specified by:
writeShortArrayin interfacePofWriter- Parameters:
iProp- the property indexan- the short[] property value to write- Throws:
IOException- if an I/O error occurs
-
writeIntArray
public void writeIntArray(int iProp, int[] an) throws IOExceptionWrite a int[] property to the POF stream.- Specified by:
writeIntArrayin interfacePofWriter- Parameters:
iProp- the property indexan- the int[] property value to write- Throws:
IOException- if an I/O error occurs
-
writeLongArray
public void writeLongArray(int iProp, long[] an) throws IOExceptionWrite a long[] property to the POF stream.- Specified by:
writeLongArrayin interfacePofWriter- Parameters:
iProp- the property indexan- the long[] property value to write- Throws:
IOException- if an I/O error occurs
-
writeFloatArray
public void writeFloatArray(int iProp, float[] afl) throws IOExceptionWrite a float[] property to the POF stream.- Specified by:
writeFloatArrayin interfacePofWriter- Parameters:
iProp- the property indexafl- the float[] property value to write- Throws:
IOException- if an I/O error occurs
-
writeDoubleArray
public void writeDoubleArray(int iProp, double[] adfl) throws IOExceptionWrite a double[] property to the POF stream.- Specified by:
writeDoubleArrayin interfacePofWriter- Parameters:
iProp- the property indexadfl- the double[] property value to write- Throws:
IOException- if an I/O error occurs
-
writeBigInteger
public void writeBigInteger(int iProp, BigInteger n) throws IOExceptionWrite a BigInteger property to the POF stream.- Specified by:
writeBigIntegerin interfacePofWriter- Parameters:
iProp- the property indexn- the BigInteger property value to write- Throws:
IOException- if an I/O error occurs
-
writeRawQuad
public void writeRawQuad(int iProp, RawQuad qfl) throws IOExceptionWrite a RawQuad property to the POF stream.- Specified by:
writeRawQuadin interfacePofWriter- Parameters:
iProp- the property indexqfl- the RawQuad property value to write- Throws:
IOException- if an I/O error occurs
-
writeBigDecimal
public void writeBigDecimal(int iProp, BigDecimal dec) throws IOExceptionWrite a BigDecimal property to the POF stream.- Specified by:
writeBigDecimalin interfacePofWriter- Parameters:
iProp- the property indexdec- the BigDecimal property value to write- Throws:
IOException- if an I/O error occurs
-
writeBinary
public void writeBinary(int iProp, Binary bin) throws IOExceptionWrite aBinaryproperty to the POF stream.- Specified by:
writeBinaryin interfacePofWriter- Parameters:
iProp- the property indexbin- the Binary property value to write- Throws:
IOException- if an I/O error occurs
-
writeString
public void writeString(int iProp, String s) throws IOExceptionWrite a String property to the POF stream.- Specified by:
writeStringin interfacePofWriter- Parameters:
iProp- the property indexs- the String property value to write- Throws:
IOException- if an I/O error occurs
-
writeDate
public void writeDate(int iProp, Date dt) throws IOExceptionWrite a Date property to the POF stream in ISO8601 format.This method encodes the year, month and day information of the specified Date object. No time or timezone information is encoded.
- Specified by:
writeDatein interfacePofWriter- Parameters:
iProp- the property indexdt- the Date property value to write in ISO8601 format- Throws:
IOException- if an I/O error occurs
-
writeDate
public void writeDate(int iProp, LocalDate dt) throws IOExceptionDescription copied from interface:PofWriterWrite a LocalDate property to the POF stream in ISO8601 format.This method encodes the year, month and day information of the specified LocalDate object. No time or timezone information is encoded.
- Specified by:
writeDatein interfacePofWriter- Parameters:
iProp- the property indexdt- the LocalDate property value to write in ISO8601 format- Throws:
IOException- if an I/O error occurs
-
writeDateTime
public void writeDateTime(int iProp, Date dt) throws IOExceptionWrite a Date property to the POF stream in ISO8601 format.This method encodes the year, month, day, hour, minute, second and millisecond information of the specified Date object. No timezone information is encoded.
- Specified by:
writeDateTimein interfacePofWriter- Parameters:
iProp- the property indexdt- the Date property value to write in ISO8601 format- Throws:
IOException- if an I/O error occurs
-
writeDateTime
public void writeDateTime(int iProp, LocalDateTime dt) throws IOExceptionDescription copied from interface:PofWriterWrite a LocalDateTime property to the POF stream in ISO8601 format.This method encodes the year, month, day, hour, minute, second and millisecond information of the specified LocalDateTime object. No timezone information is encoded.
- Specified by:
writeDateTimein interfacePofWriter- Parameters:
iProp- the property indexdt- the LocalDateTime property value to write in ISO8601 format- Throws:
IOException- if an I/O error occurs
-
writeDateTime
public void writeDateTime(int iProp, Timestamp dt) throws IOExceptionWrite a Timestamp property to the POF stream in ISO8601 format.This method encodes the year, month, day, hour, minute, second, millisecond and nanosecond information of the specified Timestamp object. No timezone information is encoded.
- Specified by:
writeDateTimein interfacePofWriter- Parameters:
iProp- the property indexdt- the Timestamp property value to write in ISO8601 format- Throws:
IOException- if an I/O error occurs
-
writeDateTimeWithZone
public void writeDateTimeWithZone(int iProp, Date dt) throws IOExceptionWrite a Date property to the POF stream in ISO8601 format.This method encodes the year, month, day, hour, minute, second, millisecond and timezone information of the specified Date object.
- Specified by:
writeDateTimeWithZonein interfacePofWriter- Parameters:
iProp- the property indexdt- the Date property value to write in ISO8601 format- Throws:
IOException- if an I/O error occurs
-
writeDateTimeWithZone
public void writeDateTimeWithZone(int iProp, OffsetDateTime dt) throws IOExceptionDescription copied from interface:PofWriterWrite a OffsetDateTime property to the POF stream in ISO8601 format.This method encodes the year, month, day, hour, minute, second, millisecond and timezone information of the specified OffsetDateTime object.
- Specified by:
writeDateTimeWithZonein interfacePofWriter- Parameters:
iProp- the property indexdt- the OffsetDateTime property value to write in ISO8601 format- Throws:
IOException- if an I/O error occurs
-
writeDateTimeWithZone
public void writeDateTimeWithZone(int iProp, Timestamp dt) throws IOExceptionWrite a Timestamp property to the POF stream in ISO8601 format.This method encodes the year, month, day, hour, minute, second, millisecond, nanosecond and timezone information of the specified Timestamp object.
- Specified by:
writeDateTimeWithZonein interfacePofWriter- Parameters:
iProp- the property indexdt- the Timestamp property value to write in ISO8601 format- Throws:
IOException- if an I/O error occurs
-
writeTime
public void writeTime(int iProp, Date dt) throws IOExceptionWrite a Date property to the POF stream in ISO8601 format.This method encodes the hour, minute, second and millisecond information of the specified Date object. No year, month, day or timezone information is encoded.
- Specified by:
writeTimein interfacePofWriter- Parameters:
iProp- the property indexdt- the Date property value to write in ISO8601 format- Throws:
IOException- if an I/O error occurs
-
writeTime
public void writeTime(int iProp, LocalTime dt) throws IOExceptionDescription copied from interface:PofWriterWrite a LocalTime property to the POF stream in ISO8601 format.This method encodes the hour, minute, second and millisecond information of the specified LocalTime object. No year, month, day or timezone information is encoded.
- Specified by:
writeTimein interfacePofWriter- Parameters:
iProp- the property indexdt- the LocalTime property value to write in ISO8601 format- Throws:
IOException- if an I/O error occurs
-
writeTime
public void writeTime(int iProp, Timestamp dt) throws IOExceptionWrite a Timestamp property to the POF stream in ISO8601 format.This method encodes the hour, minute, second, millisecond and nanosecond information of the specified Timestamp object.
- Specified by:
writeTimein interfacePofWriter- Parameters:
iProp- the property indexdt- the Timestamp property value to write in ISO8601 format- Throws:
IOException- if an I/O error occurs
-
writeTimeWithZone
public void writeTimeWithZone(int iProp, Date dt) throws IOExceptionWrite a Date property to the POF stream in ISO8601 format.This method encodes the hour, minute, second, millisecond and timezone information of the specified Date object. No year, month or day information is encoded.
- Specified by:
writeTimeWithZonein interfacePofWriter- Parameters:
iProp- the property indexdt- the Date property value to write in ISO8601 format- Throws:
IOException- if an I/O error occurs
-
writeTimeWithZone
public void writeTimeWithZone(int iProp, OffsetTime dt) throws IOExceptionDescription copied from interface:PofWriterWrite a OffsetTime property to the POF stream in ISO8601 format.This method encodes the hour, minute, second, millisecond and timezone information of the specified OffsetTime object. No year, month or day information is encoded.
- Specified by:
writeTimeWithZonein interfacePofWriter- Parameters:
iProp- the property indexdt- the OffsetTime property value to write in ISO8601 format- Throws:
IOException- if an I/O error occurs
-
writeTimeWithZone
public void writeTimeWithZone(int iProp, Timestamp dt) throws IOExceptionWrite a Timestamp property to the POF stream in ISO8601 format.This method encodes the hour, minute, second, millisecond, nanosecond and timezone information of the specified Timestamp object. No year, month or day information is encoded.
- Specified by:
writeTimeWithZonein interfacePofWriter- Parameters:
iProp- the property indexdt- the Timestamp property value to write in ISO8601 format- Throws:
IOException- if an I/O error occurs
-
writeRawDate
public void writeRawDate(int iProp, RawDate date) throws IOExceptionWrite a RawDate property to the POF stream.- Specified by:
writeRawDatein interfacePofWriter- Parameters:
iProp- the property indexdate- the RawDate property value to write- Throws:
IOException- if an I/O error occurs
-
writeRawTime
public void writeRawTime(int iProp, RawTime time) throws IOExceptionWrite a RawTime property to the POF stream.- Specified by:
writeRawTimein interfacePofWriter- Parameters:
iProp- the property indextime- the RawTime property value to write- Throws:
IOException- if an I/O error occurs
-
writeRawDateTime
public void writeRawDateTime(int iProp, RawDateTime dt) throws IOExceptionWrite a RawDateTime property to the POF stream.- Specified by:
writeRawDateTimein interfacePofWriter- Parameters:
iProp- the property indexdt- the RawDateTime property value to write- Throws:
IOException- if an I/O error occurs
-
writeRawYearMonthInterval
public void writeRawYearMonthInterval(int iProp, RawYearMonthInterval interval) throws IOExceptionWrite a RawYearMonthInterval property to the POF stream.- Specified by:
writeRawYearMonthIntervalin interfacePofWriter- Parameters:
iProp- the property indexinterval- the RawYearMonthInterval property value to write- Throws:
IOException- if an I/O error occurs
-
writeRawTimeInterval
public void writeRawTimeInterval(int iProp, RawTimeInterval interval) throws IOExceptionWrite a RawTimeInterval property to the POF stream.- Specified by:
writeRawTimeIntervalin interfacePofWriter- Parameters:
iProp- the property indexinterval- the RawTimeInterval property value to write- Throws:
IOException- if an I/O error occurs
-
writeRawDayTimeInterval
public void writeRawDayTimeInterval(int iProp, RawDayTimeInterval interval) throws IOExceptionWrite a RawDayTimeInterval property to the POF stream.- Specified by:
writeRawDayTimeIntervalin interfacePofWriter- Parameters:
iProp- the property indexinterval- the RawDayTimeInterval property value to write- Throws:
IOException- if an I/O error occurs
-
writeObject
public void writeObject(int iProp, Object o) throws IOExceptionWrite an Object property to the POF stream.The given object must be an instance of one of the following:
- boolean[]
- byte[]
- char[]
- short[]
- int[]
- long[]
- float[]
- double[]
- Boolean
- Byte
- Char
- Short
- Integer
- Long
- BigInteger
- Float
- Double
RawQuad- BigDecimal
Binary- String
- Date
RawDateRawTimeRawDateTimeRawYearMonthIntervalRawTimeIntervalRawDayTimeInterval- Collection
LongArrayPortableObject
Otherwise, a
PofSerializerfor the object must be obtainable from thePofContextassociated with this PofWriter.- Specified by:
writeObjectin interfacePofWriter- Parameters:
iProp- the property indexo- the Object property to write- Throws:
IOException- if an I/O error occurs
-
writeUserType
protected void writeUserType(int iProp, Object o) throws IOExceptionWrite a user-type to the POF stream.- Parameters:
iProp- the property indexo- the object to write- Throws:
IOException- if an I/O error occurs
-
writeObjectArray
public <T> void writeObjectArray(int iProp, T[] ao) throws IOExceptionWrite an Object[] property to the POF stream.Each element of the given array must be an instance (or an array of instances) of one of the following:
- boolean[]
- byte[]
- char[]
- short[]
- int[]
- long[]
- float[]
- double[]
- Boolean
- Byte
- Char
- Short
- Integer
- Long
- BigInteger
- Float
- Double
RawQuad- BigDecimal
Binary- String
- Date
RawDateRawTimeRawDateTimeRawYearMonthIntervalRawTimeIntervalRawDayTimeInterval- Collection
LongArrayPortableObject
Otherwise, a
PofSerializerfor each element of the array must be obtainable from thePofContextassociated with this PofWriter.- Specified by:
writeObjectArrayin interfacePofWriter- Type Parameters:
T- type of the elements in the array- Parameters:
iProp- the property indexao- the Object[] property to write- Throws:
IOException- if an I/O error occurs
-
writeObjectArray
public <T> void writeObjectArray(int iProp, T[] ao, Class<? extends T> clz) throws IOExceptionWrite a uniform Object[] property to the POF stream.Each element of the given array must be an instance (or an array of instances) of one of the following:
- boolean[]
- byte[]
- char[]
- short[]
- int[]
- long[]
- float[]
- double[]
- Boolean
- Byte
- Char
- Short
- Integer
- Long
- BigInteger
- Float
- Double
RawQuad- BigDecimal
Binary- String
- Date
RawDateRawTimeRawDateTimeRawYearMonthIntervalRawTimeIntervalRawDayTimeInterval- Collection
LongArrayPortableObject
Otherwise, a
PofSerializerfor each element of the array must be obtainable from thePofContextassociated with this PofWriter.Additionally, the type of each element must be equal to the specified class.
- Specified by:
writeObjectArrayin interfacePofWriter- Type Parameters:
T- the type of the elements in the array- Parameters:
iProp- the property indexao- the Object[] property to writeclz- the class of all elements; must not be null- Throws:
IOException- if an I/O error occurs
-
writeCollection
public <T> void writeCollection(int iProp, Collection<? extends T> coll) throws IOExceptionWrite a Collection property to the POF stream.Each element of the given Collection must be an instance (or an array of instances) of one of the following:
- boolean[]
- byte[]
- char[]
- short[]
- int[]
- long[]
- float[]
- double[]
- Boolean
- Byte
- Char
- Short
- Integer
- Long
- BigInteger
- Float
- Double
RawQuad- BigDecimal
Binary- String
- Date
RawDateRawTimeRawDateTimeRawYearMonthIntervalRawTimeIntervalRawDayTimeInterval- Collection
LongArrayPortableObject
Otherwise, a
PofSerializerfor each element of the Collection must be obtainable from thePofContextassociated with this PofWriter.- Specified by:
writeCollectionin interfacePofWriter- Type Parameters:
T- the type of elements in Collection- Parameters:
iProp- the property indexcoll- the Collection property to write- Throws:
IOException- if an I/O error occurs
-
writeCollection
public <T> void writeCollection(int iProp, Collection<? extends T> coll, Class<? extends T> clz) throws IOExceptionWrite a uniform Collection property to the POF stream.Each element of the given Collection must be an instance (or an array of instances) of one of the following:
- boolean[]
- byte[]
- char[]
- short[]
- int[]
- long[]
- float[]
- double[]
- Boolean
- Byte
- Char
- Short
- Integer
- Long
- BigInteger
- Float
- Double
RawQuad- BigDecimal
Binary- String
- Date
RawDateRawTimeRawDateTimeRawYearMonthIntervalRawTimeIntervalRawDayTimeInterval- Collection
LongArrayPortableObject
Otherwise, a
PofSerializerfor each element of the Collection must be obtainable from thePofContextassociated with this PofWriter.Additionally, the type of each element must be equal to the specified class.
- Specified by:
writeCollectionin interfacePofWriter- Type Parameters:
T- the type of elements in the Collection- Parameters:
iProp- the property indexcoll- the Collection property to writeclz- the class of all elements; must not be null- Throws:
IOException- if an I/O error occurs
-
writeLongArray
public void writeLongArray(int iProp, LongArray la) throws IOExceptionDescription copied from interface:PofWriterWrite a LongArray property to the POF stream.Each element of the given LongArray must be an instance (or an array of instances) of one of the following:
- boolean[]
- byte[]
- char[]
- short[]
- int[]
- long[]
- float[]
- double[]
- Boolean
- Byte
- Char
- Short
- Integer
- Long
- BigInteger
- Float
- Double
RawQuad- BigDecimal
Binary- String
- Date
RawDateRawTimeRawDateTimeRawYearMonthIntervalRawTimeIntervalRawDayTimeInterval- Collection
LongArrayPortableObject
Otherwise, a
PofSerializerfor each element of the LongArray must be obtainable from thePofContextassociated with this PofWriter.- Specified by:
writeLongArrayin interfacePofWriter- Parameters:
iProp- the property indexla- the LongArray property to write- Throws:
IOException- if an I/O error occurs
-
writeLongArray
public void writeLongArray(int iProp, LongArray la, Class clz) throws IOExceptionWrite a uniform LongArray property to the POF stream.Each element of the given LongArray must be an instance (or an array of instances) of one of the following:
- boolean[]
- byte[]
- char[]
- short[]
- int[]
- long[]
- float[]
- double[]
- Boolean
- Byte
- Char
- Short
- Integer
- Long
- BigInteger
- Float
- Double
RawQuad- BigDecimal
Binary- String
- Date
RawDateRawTimeRawDateTimeRawYearMonthIntervalRawTimeIntervalRawDayTimeInterval- Collection
LongArrayPortableObject
Otherwise, a
PofSerializerfor each element of the LongArray must be obtainable from thePofContextassociated with this PofWriter.Additionally, the type of each element must be equal to the specified class.
- Specified by:
writeLongArrayin interfacePofWriter- Parameters:
iProp- the property indexla- the LongArray property to writeclz- the class of all elements; must not be null- Throws:
IOException- if an I/O error occurs
-
writeMap
public <K,V> void writeMap(int iProp, Map<? extends K,? extends V> map) throws IOExceptionWrite a Map property to the POF stream.Each key and value of the given Map must be an instance (or an array of instances) of one of the following:
- boolean[]
- byte[]
- char[]
- short[]
- int[]
- long[]
- float[]
- double[]
- Boolean
- Byte
- Char
- Short
- Integer
- Long
- BigInteger
- Float
- Double
RawQuad- BigDecimal
Binary- String
- Date
RawDateRawTimeRawDateTimeRawYearMonthIntervalRawTimeIntervalRawDayTimeInterval- Collection
LongArrayPortableObject
Otherwise, a
PofSerializerfor each key and value of the Map must be obtainable from thePofContextassociated with this PofWriter.- Specified by:
writeMapin interfacePofWriter- Type Parameters:
K- the key typeV- the value type- Parameters:
iProp- the property indexmap- the Map property to write- Throws:
IOException- if an I/O error occurs
-
writeMap
public <K,V> void writeMap(int iProp, Map<K,? extends V> map, Class<? extends K> clzKey) throws IOExceptionWrite a uniform key Map property to the POF stream.Each key and value of the given Map must be an instance (or an array of instances) of one of the following:
- boolean[]
- byte[]
- char[]
- short[]
- int[]
- long[]
- float[]
- double[]
- Boolean
- Byte
- Char
- Short
- Integer
- Long
- BigInteger
- Float
- Double
RawQuad- BigDecimal
Binary- String
- Date
RawDateRawTimeRawDateTimeRawYearMonthIntervalRawTimeIntervalRawDayTimeInterval- Collection
LongArrayPortableObject
Otherwise, a
PofSerializerfor each key and value of the Map must be obtainable from thePofContextassociated with this PofWriter.Additionally, the type of each key must be equal to the specified class.
- Specified by:
writeMapin interfacePofWriter- Type Parameters:
K- the key typeV- the value type- Parameters:
iProp- the property indexmap- the Map property to writeclzKey- the class of all keys; must not be null- Throws:
IOException- if an I/O error occurs
-
writeMap
public <K,V> void writeMap(int iProp, Map<K,V> map, Class<? extends K> clzKey, Class<? extends V> clzValue) throws IOExceptionWrite a uniform Map property to the POF stream.Each key and value of the given Map must be an instance (or an array of instances) of one of the following:
- boolean[]
- byte[]
- char[]
- short[]
- int[]
- long[]
- float[]
- double[]
- Boolean
- Byte
- Char
- Short
- Integer
- Long
- BigInteger
- Float
- Double
RawQuad- BigDecimal
Binary- String
- Date
RawDateRawTimeRawDateTimeRawYearMonthIntervalRawTimeIntervalRawDayTimeInterval- Collection
LongArrayPortableObject
Otherwise, a
PofSerializerfor each key and value of the Map must be obtainable from thePofContextassociated with this PofWriter.Additionally, the type of each key and value must be equal to the specified key class and value class respectively.
- Specified by:
writeMapin interfacePofWriter- Type Parameters:
K- the key typeV- the value type- Parameters:
iProp- the property indexmap- the Map property to writeclzKey- the class of all keys; must not be nullclzValue- the class of all values; must not be null- Throws:
IOException- if an I/O error occurs
-
writeOptionalInt
public void writeOptionalInt(int iProp, OptionalInt n) throws IOException- Throws:
IOException
-
writeOptionalLong
public void writeOptionalLong(int iProp, OptionalLong n) throws IOException- Throws:
IOException
-
writeOptionalDouble
public void writeOptionalDouble(int iProp, OptionalDouble n) throws IOException- Throws:
IOException
-
writeOptional
public <T> void writeOptional(int iProp, Optional<T> o) throws IOException- Throws:
IOException
-
getPofContext
public PofContext getPofContext()
Return the PofContext object used by this PofWriter to serialize user types to a POF stream.- Specified by:
getPofContextin interfacePofWriter- Returns:
- the PofContext object that contains user type meta-data
-
setPofContext
public void setPofContext(PofContext ctx)
Configure the PofContext object used by this PofWriter to serialize user types to a POF stream.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 = writer.getPofContext(); try { // switch to another PofContext PofContext ctxNew = ...; writer.setContext(ctxNew); // output POF data using the writer } finally { // restore the original PofContext writer.setPofContext(ctxOrig); }- Specified by:
setPofContextin interfacePofWriter- Parameters:
ctx- the new PofContext; must not be null
-
getUserTypeId
public int getUserTypeId()
Determine the user type that is currently being written.- Specified by:
getUserTypeIdin interfacePofWriter- Returns:
- the user type identifier, or -1 if the PofWriter is not currently writing a user type
-
getVersionId
public int getVersionId()
Determine the version identifier of the user type that is currently being written.- Specified by:
getVersionIdin interfacePofWriter- Returns:
- the integer version ID of the user type; always non-negative
-
setVersionId
public void setVersionId(int nVersionId)
Set the version identifier of the user type that is currently being written.- Specified by:
setVersionIdin interfacePofWriter- Parameters:
nVersionId- the user type identifier; must be non-negative
-
createNestedPofWriter
public PofWriter createNestedPofWriter(int iProp) throws IOException
Obtain a PofWriter that can be used to write a set of properties into a single property of the current user type. The returned PofWriter is only valid from the time that it is returned until the next call is made to this PofWriter.- Specified by:
createNestedPofWriterin interfacePofWriter- Parameters:
iProp- the property index- Returns:
- a PofWriter whose contents are nested into a single property of this PofWriter
- Throws:
IOException- if an I/O error occurs
-
createNestedPofWriter
public PofWriter createNestedPofWriter(int iProp, int nTypeId) throws IOException
Obtain a PofWriter that can be used to write a set of properties into a single property of the current user type. The returned PofWriter is only valid from the time that it is returned until the next call is made to this PofWriter.- Specified by:
createNestedPofWriterin interfacePofWriter- Parameters:
iProp- the property indexnTypeId- the type identifier of the nested property- Returns:
- a PofWriter whose contents are nested into a single property of this PofWriter
- Throws:
IOException- if an I/O error occurs
-
writeRemainder
public void writeRemainder(Binary binProps) throws IOException
Write the remaining properties to the POF stream, terminating the writing of the current user type. As part of writing out a user type, this method must be called by the PofSerializer that is writing out the user type, or the POF stream will be corrupted.Calling this method terminates the current user type by writing a -1 to the POF stream after the last indexed property. Subsequent calls to the various writeXYZ methods of this interface will fail after this method is called.
- Specified by:
writeRemainderin interfacePofWriter- Parameters:
binProps- a Binary object containing zero or more indexed properties in binary POF encoded form; may be null- Throws:
IOException- if an I/O error occurs
-
getParentWriter
protected PofBufferWriter getParentWriter()
If this writer is contextually within a user type, obtain the writer which created this writer in order to write the user type.- Returns:
- the containing writer
-
beginProperty
protected void beginProperty(int iProp) throws IOExceptionReport that a POF property is about to be written to the POF stream.This method call will be followed by one or more separate calls to a "write" method and the property extent will then be terminated by a call to
endProperty(int).- Parameters:
iProp- the index of the property being written- Throws:
IllegalArgumentException- if the property index is invalid, or is less than or equal to the index of the previous property written to the POF streamIOException- if an I/O error occurs
-
endProperty
protected void endProperty(int iProp)
Signifies the termination of the current POF property.- Parameters:
iProp- the index of the current property
-
onException
protected void onException(Exception e) throws IOException
Called when an unexpected exception is caught while writing to the POF stream.If the given exception wraps an IOException, the IOException is unwrapped and rethrown; otherwise the given exception is rethrown.
- Parameters:
e- the exception- Throws:
IOException- the wrapped IOException, if the given exception is a wrapped IOException
-
fixNanos
protected static Date fixNanos(Date dt)
Return aDatewhich is suitable for POF serializationSimilar to
Timestamp, POF requires that dates have positive sub-second values.- Parameters:
dt- the Date object to check- Returns:
- the passed in Date if no conversion is necessary; otherwise the passed in Date as a Timestamp.
- Since:
- Coherence 3.7.1.13
-
getNanos
protected static int getNanos(Date dt)
Extract the nanoseconds from the date. This number represents a fraction of a second in the passed-in date expressed with a nanosecond resolution.- Parameters:
dt- the Date object to extract the nanoseconds from- Returns:
- the number of nanoseconds in the date
-
assertEqual
protected static void assertEqual(Class clz, Class clzTest)
Assert that a class is equal to another class.- Parameters:
clz- the expected class; must not be nullclzTest- the class to test for equality; must not be null- Throws:
IllegalArgumentException- if the second class is not equal to the first
-
getBufferOutput
protected WriteBuffer.BufferOutput getBufferOutput()
Return the BufferOutput that this PofBufferWriter writes to.- Returns:
- the BufferOutput
-
getPofHandler
protected WritingPofHandler getPofHandler()
Return the WritingPofHandler used internally by this PofBufferWriter to write the POF stream.- Returns:
- the PofHandler
-
enableReference
public void enableReference()
Ensure that reference support (necessary for cyclic dependencies) is enabled.
-
isReferenceEnabled
public boolean isReferenceEnabled()
Determine if reference support is enabled.- Returns:
- true iff reference support is enabled
-
isEvolvable
protected boolean isEvolvable()
Determine if the object to be written is either Evolvable or part of an Evolvable object.- Returns:
- true iff the object to be written is Evolvable
-
setEvolvable
protected void setEvolvable(boolean fEvolvable)
Set the Evolvable flag to indicate if the object to be written is Evolvable or part of an Evolvable object.- Parameters:
fEvolvable- true iff the object to be written is Evolvable
-
main
public static void main(String[] args)
-
-