| java.lang.Object org.apache.derby.impl.drda.DRDAString
DRDAString | final class DRDAString (Code) | | This class provides functionality for reusing buffers and strings
when parsing DRDA packets. A byte array representing a string is
stored internally. When the string is requested as a
String object, the byte array is converted to a
string, and the string is cached to avoid unnecessary conversion
later.
|
Method Summary | |
public byte[] | getBytes() Return the internal byte array. | public int | length() Return the length in bytes of the internal string
representation. | public void | setBytes(byte[] src, int offset, int size) Modify the internal byte buffer. | public String | toString() Convert the internal byte array to a string. | public boolean | wasModified() Check whether the contents of the DRDAString were
modified in the previous call to setBytes() . |
DRDAString | DRDAString(CcsidManager m)(Code) | | Create a new DRDAString instance.
Parameters: m - a CcsidManager value specifyingwhich encoding is used |
getBytes | public byte[] getBytes()(Code) | | Return the internal byte array. The returned array should not
be modified, as it is used internally in
DRDAString . The value of the array might be
modified by subsequent calls to
DRDAString.setBytes() .
internal buffer |
length | public int length()(Code) | | Return the length in bytes of the internal string
representation.
length of internal representation |
setBytes | public void setBytes(byte[] src, int offset, int size)(Code) | | Modify the internal byte buffer. If the new data is equal to
the old data, the cached values are not cleared.
Parameters: src - the new bytes Parameters: offset - start offset Parameters: size - number of bytes to use |
toString | public String toString()(Code) | | Convert the internal byte array to a string. The string value
is cached.
a String value |
wasModified | public boolean wasModified()(Code) | | Check whether the contents of the DRDAString were
modified in the previous call to setBytes() .
true if the contents were modified |
|
|