in hessian-lite/src/main/java/com/alibaba/com/caucho/hessian/io/Hessian2Input.java [1457:1495]
public int readChar()
throws IOException {
if (_chunkLength > 0) {
_chunkLength--;
if (_chunkLength == 0 && _isLastChunk)
_chunkLength = END_OF_DATA;
int ch = parseUTF8Char();
return ch;
} else if (_chunkLength == END_OF_DATA) {
_chunkLength = 0;
return -1;
}
int tag = read();
switch (tag) {
case 'N':
return -1;
case 'S':
case BC_STRING_CHUNK:
_isLastChunk = tag == 'S';
_chunkLength = (read() << 8) + read();
_chunkLength--;
int value = parseUTF8Char();
// special code so successive read byte won't
// be read as a single object.
if (_chunkLength == 0 && _isLastChunk)
_chunkLength = END_OF_DATA;
return value;
default:
throw expect("char", tag);
}
}