|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.derby.iapi.jdbc.CharacterStreamDescriptor.Builder
public static class CharacterStreamDescriptor.Builder
The builder for the CharacterStreamDescriptor
class. The builder
is used to avoid having a large set of constructors. See the
build() method for pre-build field validation. Note that the
validation is only performed in sane builds.
Field Summary | |
---|---|
private boolean |
bufferable
|
private long |
byteLength
|
private long |
charLength
|
private long |
curBytePos
|
private long |
curCharPos
|
private long |
dataOffset
|
private static long |
DEFAULT_MAX_CHAR_LENGTH
Default max character length is unlimited. |
private long |
maxCharLength
|
private boolean |
positionAware
|
private java.io.InputStream |
stream
|
Constructor Summary | |
---|---|
CharacterStreamDescriptor.Builder()
Creates a builder object. |
Method Summary | |
---|---|
CharacterStreamDescriptor.Builder |
bufferable(boolean bufferable)
Sets if the stream should be buffered, defaults to false . |
CharacterStreamDescriptor |
build()
Creates a descriptor object based on the parameters kept in the builder instance. |
CharacterStreamDescriptor.Builder |
byteLength(long length)
Sets the byte length of the stream, defaults to 0 . |
CharacterStreamDescriptor.Builder |
charLength(long length)
Sets the character length of the stream, defaults to 0 . |
CharacterStreamDescriptor.Builder |
copyState(CharacterStreamDescriptor csd)
Copies the state of the specified descriptor. |
CharacterStreamDescriptor.Builder |
curBytePos(long pos)
Sets the current byte position, defaults to 0 . |
CharacterStreamDescriptor.Builder |
curCharPos(long pos)
Sets the current character position, defaults to 1 . |
CharacterStreamDescriptor.Builder |
dataOffset(long offset)
Sets the offset of the user data, defaults to 0 . |
CharacterStreamDescriptor.Builder |
maxCharLength(long length)
Imposes a length limit on the stream, expressed in number of characters, defaults to Long.MAX_VALUE . |
CharacterStreamDescriptor.Builder |
positionAware(boolean positionAware)
Sets if the stream can reposition itself or not, defaults to false . |
CharacterStreamDescriptor.Builder |
stream(java.io.InputStream stream)
Sets the stream described by the descriptor. |
java.lang.String |
toString()
Returns a textual representation of the builder. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
private static final long DEFAULT_MAX_CHAR_LENGTH
private boolean bufferable
private boolean positionAware
private long curBytePos
private long curCharPos
private long byteLength
private long charLength
private long dataOffset
private long maxCharLength
private java.io.InputStream stream
Constructor Detail |
---|
public CharacterStreamDescriptor.Builder()
Method Detail |
---|
public CharacterStreamDescriptor.Builder bufferable(boolean bufferable)
false
.
bufferable
- true
if buffering is advised, false
if not
public CharacterStreamDescriptor.Builder positionAware(boolean positionAware)
false
.
positionAware
- true
if the stream can reposition
itself, false
if not
public CharacterStreamDescriptor.Builder curBytePos(long pos)
0
.
pos
- the current byte position
public CharacterStreamDescriptor.Builder curCharPos(long pos)
1
.
There is a special value for when the stream is position in the
header area - BEFORE_FIRST
.
pos
- the current character position,starting at 1
CharacterStreamDescriptor.BEFORE_FIRST
public CharacterStreamDescriptor.Builder byteLength(long length)
0
.
A length of 0
means the length is unknown.
length
- the byte length of the stream (including header)
public CharacterStreamDescriptor.Builder copyState(CharacterStreamDescriptor csd)
csd
- the descriptor to copy
public CharacterStreamDescriptor.Builder charLength(long length)
0
.
Headers are not included in this length, only the user data.
A length of 0
means the length is unknown.
length
- the character length of the stream
public CharacterStreamDescriptor.Builder dataOffset(long offset)
0
.
offset
- first index with user data, zero based
public CharacterStreamDescriptor.Builder maxCharLength(long length)
Long.MAX_VALUE
.
length
- maximum number of characters
public CharacterStreamDescriptor.Builder stream(java.io.InputStream stream)
The stream is not allowed to be null
.
stream
- the stream
public CharacterStreamDescriptor build()
Default values will be used for parameters for which a value hasn't been set.
NOTE: Parameter validation is only performed in sane builds.
public java.lang.String toString()
toString
in class java.lang.Object
|
Built on Thu 2010-12-23 20:49:13+0000, from revision ??? | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |