public class StringDecoder extends Object
This class is not thread safe.
| Constructor and Description |
|---|
StringDecoder()
Creates a new StringDecoder.
|
StringDecoder(StringDecoderCache cache)
Creates a new StringDecoder.
|
| Modifier and Type | Method and Description |
|---|---|
String |
decode(byte[] source,
int offset,
int length)
Decode a string of a known length.
|
StringDecoderCache |
getCache()
Deprecated.
The cache
StringDecoderCache should be controlled
directly. This method will be removed after the 2.1.0
release. |
public StringDecoder()
public StringDecoder(StringDecoderCache cache)
cache - The cache for the decoder.public String decode(byte[] source, int offset, int length) throws StreamCorruptedException, EOFException
source - The source of the bytes in the string.offset - The offset of the first byte to decode.length - The length of the string to decode with a terminal zero byte.StreamCorruptedException - On the decoding of the string failing.EOFException - On the array not containing enough bytes to decoded.@Deprecated public StringDecoderCache getCache()
StringDecoderCache should be controlled
directly. This method will be removed after the 2.1.0
release.Copyright © 2011–2014 Allanbank Consulting, Inc.. All rights reserved.