use of org.hsqldb_voltpatches.lib.HsqlByteArrayInputStream in project voltdb by VoltDB.
the class LobManager method getChars.
public Result getChars(Session session, long lobID, long offset, int length) {
Result result = getBytes(session, lobID, offset * 2, length * 2);
if (result.isError()) {
return result;
}
byte[] bytes = ((ResultLob) result).getByteArray();
HsqlByteArrayInputStream be = new HsqlByteArrayInputStream(bytes);
char[] chars = new char[bytes.length / 2];
try {
for (int i = 0; i < chars.length; i++) {
chars[i] = be.readChar();
}
} catch (Exception e) {
return Result.newErrorResult(e);
}
return ResultLob.newLobGetCharsResponse(lobID, offset, chars);
}
Aggregations