use of org.hsqldb_voltpatches.result.ResultLob 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);
}
use of org.hsqldb_voltpatches.result.ResultLob in project voltdb by VoltDB.
the class BlobDataID method length.
public long length(SessionInterface session) {
ResultLob resultOut = ResultLob.newLobGetLengthRequest(id);
Result resultIn = session.execute(resultOut);
if (resultIn.isError()) {
throw resultIn.getException();
}
return ((ResultLob) resultIn).getBlockLength();
}
use of org.hsqldb_voltpatches.result.ResultLob in project voltdb by VoltDB.
the class BlobDataID method getBlob.
public BlobData getBlob(SessionInterface session, long pos, long length) {
ResultLob resultOut = ResultLob.newLobGetRequest(id, pos, length);
Result resultIn = session.execute(resultOut);
if (resultIn.isError()) {
throw Error.error(resultIn);
}
long lobID = ((ResultLob) resultIn).getLobID();
return new BlobDataID(lobID);
}
use of org.hsqldb_voltpatches.result.ResultLob in project voltdb by VoltDB.
the class BlobDataID method truncate.
public void truncate(SessionInterface session, long len) {
ResultLob resultOut = ResultLob.newLobTruncateRequest(id, len);
Result resultIn = session.execute(resultOut);
if (resultIn.isError()) {
throw resultIn.getException();
}
}
use of org.hsqldb_voltpatches.result.ResultLob in project voltdb by VoltDB.
the class ClobDataID method length.
public long length(SessionInterface session) {
ResultLob resultOut = ResultLob.newLobGetLengthRequest(id);
Result resultIn = session.execute(resultOut);
if (resultIn.isError()) {
throw resultIn.getException();
}
return ((ResultLob) resultIn).getBlockLength();
}
Aggregations