String object, the byte array is converted to a
string, and the string is cached to avoid unnecessary conversion
later.
| Modifier and Type | Field and Description |
|---|---|
| private byte[] | buffer
Buffer representing the string. |
| private String | cachedString
The previously generated string. |
| private boolean | modified
True if the contents were modified in the previous call to
|
| private final DDMWriter | writer
Keep the DDMWriter as it contains the current CCSID manager being used |
| Access | Constructor and Description |
|---|---|
| pack-priv | DRDAString(DDMWriter
a w)DDMWriter which holds current CCSidManager
and which encoding is usedCreate a new |
| Modifier and Type | Method and Description |
|---|---|
| private boolean | Returns: true if the internal buffer contains the
same data as the specified byte arraya byte array buf, int start position in the byte array offset, int how many bytes to read from the byte array size)Check whether the internal buffer contains the same data as another byte buffer. |
| public byte[] | |
| public int | Returns: length of internal representationReturn the length in bytes of the internal string representation. |
| public void | setBytes(byte[]
the new bytes src, int start offset offset, int number of bytes to use size)Modify the internal byte buffer. |
| public String | Returns: aString valueOverrides java. |
| public boolean | Returns: true if the contents were modifiedCheck whether the contents of the |
| buffer | back to summary |
|---|---|
| private byte[] buffer Buffer representing the string. | |
| cachedString | back to summary |
|---|---|
| private String cachedString The previously generated string. | |
| modified | back to summary |
|---|---|
| private boolean modified True if the contents were modified in the previous call to
| |
| writer | back to summary |
|---|---|
| private final DDMWriter writer Keep the DDMWriter as it contains the current CCSID manager being used | |
| DRDAString | back to summary |
|---|---|
| pack-priv DRDAString(DDMWriter w) Create a new
| |
| equalTo | back to summary |
|---|---|
| private boolean equalTo(byte[] buf, int offset, int size) Check whether the internal buffer contains the same data as another byte buffer.
| |
| getBytes | back to summary |
|---|---|
| public byte[] getBytes() Return the internal byte array. The returned array should not
be modified, as it is used internally in
| |
| length | back to summary |
|---|---|
| public int length() Return the length in bytes of the internal string representation.
| |
| setBytes | back to summary |
|---|---|
| public void setBytes(byte[] src, int offset, int size) Modify the internal byte buffer. If the new data is equal to the old data, the cached values are not cleared.
| |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Convert the internal byte array to a string. The string value is cached.
| |
| wasModified | back to summary |
|---|---|
| public boolean wasModified() Check whether the contents of the
| |