try {
int offset = (int) ((RubyFixnum) _offset).getLongValue();
int fd = (int) ((RubyFixnum) _fd).getLongValue();
int whence = (int) ((RubyFixnum) _whence).getLongValue();
int where = postgresqlConnection.getLargeObjectAPI().loSeek(fd, offset, whence);
return new RubyFixnum(context.runtime, where);
} catch (IOException e) {
throw newPgError(context, "lo_lseek failed: " + e.getLocalizedMessage(), null, getClientEncodingAsJavaEncoding(context));
} catch (PostgresqlException e) {
throw newPgError(context, "lo_lseek failed: " + e.getLocalizedMessage(), e.getResultSet(), getClientEncodingAsJavaEncoding(context));
}