public class TupleBase<E>
extends java.lang.Object
Tuple bindings and key creators append data to a TupleOutput
instance, which is also a FastOutputStream
instance. This object has a byte array buffer that is resized when it is
full. The reallocation of this buffer can be a performance factor for
some applications using large objects. To manage this issue, the setTupleBufferSize(int)
method may be used to control the initial size of the
buffer, and the getTupleOutput(E)
method may be overridden by
subclasses to take over creation of the TupleOutput object.
Constructor and Description |
---|
TupleBase()
Initializes the initial output buffer size to zero.
|
Modifier and Type | Method and Description |
---|---|
static TupleInput |
entryToInput(DatabaseEntry entry)
Utility method to create a new tuple input object for reading the data
from a given buffer.
|
int |
getTupleBufferSize()
Returns the initial byte size of the output buffer.
|
static void |
inputToEntry(TupleInput input,
DatabaseEntry entry)
Utility method to set the data in a entry buffer to the data in a tuple
input object.
|
static TupleOutput |
newOutput()
Deprecated.
replaced by
getTupleOutput(E) |
static TupleOutput |
newOutput(byte[] buffer)
Deprecated.
replaced by
getTupleOutput(E) |
static void |
outputToEntry(TupleOutput output,
DatabaseEntry entry)
Utility method to set the data in a entry buffer to the data in a tuple
output object.
|
void |
setTupleBufferSize(int byteSize)
Sets the initial byte size of the output buffer that is allocated by the
default implementation of
getTupleOutput(E) . |
public TupleBase()
Unless setTupleBufferSize(int)
is called, the default FastOutputStream.DEFAULT_INIT_SIZE
size will be
used.
public void setTupleBufferSize(int byteSize)
getTupleOutput(E)
.
If this property is zero (the default), the default FastOutputStream.DEFAULT_INIT_SIZE
size is used.
byteSize
- the initial byte size of the output buffer, or zero to
use the default size.public int getTupleBufferSize()
setTupleBufferSize(int)
public static void outputToEntry(TupleOutput output, DatabaseEntry entry)
output
- is the source tuple output object.entry
- is the destination entry buffer.public static void inputToEntry(TupleInput input, DatabaseEntry entry)
input
- is the source tuple input object.entry
- is the destination entry buffer.public static TupleInput entryToInput(DatabaseEntry entry)
entry
- is the source entry buffer.public static TupleOutput newOutput()
getTupleOutput(E)
public static TupleOutput newOutput(byte[] buffer)
getTupleOutput(E)
Copyright (c) 2004,2014 Oracle. All rights reserved.