|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.derby.iapi.types.CharStreamHeaderGenerator
public final class CharStreamHeaderGenerator
Generates stream headers for non-Clob string data types.
The stream header encodes the byte length of the stream. Since two bytes are used for the header, the maximum encodable length is 65535 bytes. There are three special cases, all handled by encoding zero into the header and possibly appending an EOF-marker to the stream:
out.writeByte((byte)(byteLength >>> 8)); out.writeByte((byte)(byteLength >>> 0));
Field Summary | |
---|---|
private static int |
MAX_ENCODABLE_LENGTH
The maximum length that can be encoded by the header. |
Fields inherited from interface org.apache.derby.iapi.types.StreamHeaderGenerator |
---|
DERBY_EOF_MARKER |
Constructor Summary | |
---|---|
CharStreamHeaderGenerator()
|
Method Summary | |
---|---|
boolean |
expectsCharCount()
A byte count is expected. |
int |
generateInto(byte[] buffer,
int offset,
long byteLength)
Generates the header for the specified length and writes it into the provided buffer, starting at the specified offset. |
int |
generateInto(java.io.ObjectOutput out,
long byteLength)
Generates the header for the specified length. |
int |
getMaxHeaderLength()
Returns the maximum header length. |
int |
writeEOF(byte[] buffer,
int offset,
long byteLength)
Writes a Derby-specific end-of-stream marker to the buffer for a stream of the specified byte length, if required. |
int |
writeEOF(java.io.ObjectOutput out,
long byteLength)
Writes a Derby-specific end-of-stream marker to the destination stream for the specified byte length, if required. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private static final int MAX_ENCODABLE_LENGTH
Constructor Detail |
---|
public CharStreamHeaderGenerator()
Method Detail |
---|
public boolean expectsCharCount()
expectsCharCount
in interface StreamHeaderGenerator
false
.public int generateInto(byte[] buffer, int offset, long byteLength)
generateInto
in interface StreamHeaderGenerator
buffer
- the buffer to write intooffset
- starting offset in the bufferbyteLength
- the length to encode in the header
public int generateInto(java.io.ObjectOutput out, long byteLength) throws java.io.IOException
generateInto
in interface StreamHeaderGenerator
out
- the destination streambyteLength
- the byte length to encode in the header
java.io.IOException
- if writing to the destination stream failspublic int writeEOF(byte[] buffer, int offset, long byteLength)
writeEOF
in interface StreamHeaderGenerator
buffer
- the buffer to write intooffset
- starting offset in the bufferbyteLength
- the byte length of the stream
public int writeEOF(java.io.ObjectOutput out, long byteLength) throws java.io.IOException
writeEOF
in interface StreamHeaderGenerator
out
- the destination streambyteLength
- the length of the stream
java.io.IOException
- if writing to the destination stream failspublic int getMaxHeaderLength()
getMaxHeaderLength
in interface StreamHeaderGenerator
|
Built on Thu 2012-03-29 21:53:33+0000, from revision ??? | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |