com.sleepycat.persist.impl
Class RecordOutput

java.lang.Object
  extended by java.io.OutputStream
      extended by com.sleepycat.util.FastOutputStream
          extended by com.sleepycat.bind.tuple.TupleOutput
              extended by com.sleepycat.persist.impl.RecordOutput
All Implemented Interfaces:
EntityOutput, Closeable, Flushable

 class RecordOutput
extends TupleOutput
implements EntityOutput

Implements EntityOutput to write record key-data pairs. Extends TupleOutput to implement the subset of TupleOutput methods that are defined in the EntityOutput interface.

Author:
Mark Hayes

Field Summary
 
Fields inherited from class com.sleepycat.util.FastOutputStream
DEFAULT_BUMP_SIZE, DEFAULT_INIT_SIZE
 
Constructor Summary
RecordOutput(Catalog catalog, boolean rawAccess)
          Creates a new output with an empty/null visited map.
 
Method Summary
 void registerEntity(Object entity)
          Registers the top level entity before writing it, to allow nested fields to reference their parent entity.
 void registerPriKeyObject(Object o)
          Called via Accessor.writeSecKeyFields for a primary key field with a reference type.
 void writeArrayLength(int length)
          Called by ObjectArrayFormat and PrimitiveArrayFormat to write the array length.
 void writeEnumConstant(String[] names, int index)
          Called by EnumFormat to write the given index of the enum constant.
 void writeKeyObject(Object o, Format fieldFormat)
          Called for a primary key field or composite key field with a reference type.
 void writeObject(Object o, Format fieldFormat)
          Called via Accessor to write all fields with reference types, except for the primary key field and composite key fields (see writeKeyObject below).
 
Methods inherited from class com.sleepycat.bind.tuple.TupleOutput
getBigDecimalMaxByteLength, getBigIntegerByteLength, getSortedBigDecimalMaxByteLength, writeBigDecimal, writeBigInteger, writeBoolean, writeByte, writeBytes, writeBytes, writeChar, writeChars, writeChars, writeDouble, writeFloat, writeInt, writeLong, writePackedInt, writePackedLong, writeShort, writeSortedBigDecimal, writeSortedDouble, writeSortedFloat, writeSortedPackedInt, writeSortedPackedLong, writeString, writeString, writeUnsignedByte, writeUnsignedInt, writeUnsignedShort
 
Methods inherited from class com.sleepycat.util.FastOutputStream
addSize, getBufferBytes, getBufferLength, getBufferOffset, makeSpace, reset, size, toByteArray, toString, toString, write, write, write, writeFast, writeFast, writeFast, writeTo
 
Methods inherited from class java.io.OutputStream
close, flush
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface com.sleepycat.persist.impl.EntityOutput
writeBigInteger, writeBoolean, writeByte, writeChar, writeInt, writeLong, writeShort, writeSortedBigDecimal, writeSortedDouble, writeSortedFloat, writeString
 

Constructor Detail

RecordOutput

RecordOutput(Catalog catalog,
             boolean rawAccess)
Creates a new output with an empty/null visited map.

Method Detail

writeObject

public void writeObject(Object o,
                        Format fieldFormat)
                 throws RefreshException
Description copied from interface: EntityOutput
Called via Accessor to write all fields with reference types, except for the primary key field and composite key fields (see writeKeyObject below).

Specified by:
writeObject in interface EntityOutput
Throws:
RefreshException
See Also:
EntityOutput.writeObject(java.lang.Object, com.sleepycat.persist.impl.Format)

writeKeyObject

public void writeKeyObject(Object o,
                           Format fieldFormat)
                    throws RefreshException
Description copied from interface: EntityOutput
Called for a primary key field or composite key field with a reference type.

Specified by:
writeKeyObject in interface EntityOutput
Throws:
RefreshException
See Also:
EntityOutput.writeKeyObject(java.lang.Object, com.sleepycat.persist.impl.Format)

registerPriKeyObject

public void registerPriKeyObject(Object o)
Description copied from interface: EntityOutput
Called via Accessor.writeSecKeyFields for a primary key field with a reference type. This method must be called before writing any other fields.

Specified by:
registerPriKeyObject in interface EntityOutput
See Also:
EntityOutput.registerPriKeyObject(java.lang.Object)

registerEntity

public void registerEntity(Object entity)
Registers the top level entity before writing it, to allow nested fields to reference their parent entity. [#17525]


writeArrayLength

public void writeArrayLength(int length)
Description copied from interface: EntityOutput
Called by ObjectArrayFormat and PrimitiveArrayFormat to write the array length.

Specified by:
writeArrayLength in interface EntityOutput
See Also:
EntityOutput.writeArrayLength(int)

writeEnumConstant

public void writeEnumConstant(String[] names,
                              int index)
Description copied from interface: EntityOutput
Called by EnumFormat to write the given index of the enum constant.

Specified by:
writeEnumConstant in interface EntityOutput
See Also:
EntityOutput.writeEnumConstant(java.lang.String[], int)


Copyright (c) 2004-2012 Oracle. All rights reserved.