本文整理汇总了Java中org.hsqldb.lib.DataOutputStream.writeLong方法的典型用法代码示例。如果您正苦于以下问题:Java DataOutputStream.writeLong方法的具体用法?Java DataOutputStream.writeLong怎么用?Java DataOutputStream.writeLong使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.hsqldb.lib.DataOutputStream
的用法示例。
在下文中一共展示了DataOutputStream.writeLong方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: write
import org.hsqldb.lib.DataOutputStream; //导入方法依赖的package包/类
protected void write(Result r) throws IOException, HsqlException {
HsqlByteArrayOutputStream memStream = new HsqlByteArrayOutputStream();
DataOutputStream tempOutput = new DataOutputStream(memStream);
r.write(this, tempOutput, rowOut);
httpConnection.setRequestMethod("POST");
httpConnection.setDoOutput(true);
httpConnection.setUseCaches(false);
//httpConnection.setRequestProperty("Accept-Encoding", "gzip");
httpConnection.setRequestProperty("Content-Type",
"application/octet-stream");
httpConnection.setRequestProperty("Content-Length",
String.valueOf(IDLENGTH
+ memStream.size()));
dataOutput = new DataOutputStream(httpConnection.getOutputStream());
dataOutput.writeInt(r.getDatabaseId());
dataOutput.writeLong(r.getSessionId());
memStream.writeTo(dataOutput);
dataOutput.flush();
}
示例2: writeCreate
import org.hsqldb.lib.DataOutputStream; //导入方法依赖的package包/类
private void writeCreate(SessionInterface session,
DataOutputStream dataOut) throws IOException {
dataOut.writeByte(mode);
dataOut.writeInt(databaseID);
dataOut.writeLong(sessionID);
dataOut.writeLong(lobID);
dataOut.writeInt(subType);
dataOut.writeLong(blockOffset);
dataOut.writeLong(blockLength);
switch (subType) {
case LobResultTypes.REQUEST_CREATE_BYTES :
dataOut.write(stream, blockLength);
break;
case LobResultTypes.REQUEST_CREATE_CHARS :
dataOut.write(reader, blockLength);
break;
}
}
示例3: writeCreateByteSegments
import org.hsqldb.lib.DataOutputStream; //导入方法依赖的package包/类
private void writeCreateByteSegments(SessionInterface session,
DataOutputStream dataOut)
throws IOException {
//
int bufferLength = session.getStreamBlockSize();
long currentOffset = blockOffset;
dataOut.writeByte(mode);
dataOut.writeInt(databaseID);
dataOut.writeLong(sessionID);
dataOut.writeLong(lobID);
dataOut.writeInt(subType);
HsqlByteArrayOutputStream byteArrayOS =
new HsqlByteArrayOutputStream(bufferLength);
byteArrayOS.reset();
byteArrayOS.write(stream, bufferLength);
dataOut.writeLong(currentOffset);
dataOut.writeLong(byteArrayOS.size());
dataOut.write(byteArrayOS.getBuffer(), 0, byteArrayOS.size());
currentOffset += byteArrayOS.size();
if (byteArrayOS.size() < bufferLength) {
return;
}
//
while (true) {
byteArrayOS.reset();
byteArrayOS.write(stream, bufferLength);
if (byteArrayOS.size() == 0) {
break;
}
//
dataOut.writeByte(mode);
dataOut.writeInt(databaseID);
dataOut.writeLong(sessionID);
dataOut.writeLong(lobID);
dataOut.writeInt(LobResultTypes.REQUEST_SET_BYTES);
dataOut.writeLong(currentOffset);
dataOut.writeLong(byteArrayOS.size());
dataOut.write(byteArrayOS.getBuffer(), 0, byteArrayOS.size());
currentOffset += byteArrayOS.size();
if (byteArrayOS.size() < bufferLength) {
break;
}
}
}
示例4: writeCreateCharSegments
import org.hsqldb.lib.DataOutputStream; //导入方法依赖的package包/类
private void writeCreateCharSegments(SessionInterface session,
DataOutputStream dataOut)
throws IOException {
//
int bufferLength = session.getStreamBlockSize();
long currentOffset = blockOffset;
dataOut.writeByte(mode);
dataOut.writeInt(databaseID);
dataOut.writeLong(sessionID);
dataOut.writeLong(lobID);
dataOut.writeInt(subType);
HsqlByteArrayOutputStream byteArrayOS =
new HsqlByteArrayOutputStream(bufferLength);
byteArrayOS.reset();
byteArrayOS.write(reader, bufferLength / 2);
//
dataOut.writeLong(currentOffset);
dataOut.writeLong(byteArrayOS.size() / 2);
dataOut.write(byteArrayOS.getBuffer(), 0, byteArrayOS.size());
currentOffset += byteArrayOS.size() / 2;
if (byteArrayOS.size() < bufferLength) {
return;
}
//
while (true) {
byteArrayOS.reset();
byteArrayOS.write(reader, bufferLength / 2);
if (byteArrayOS.size() == 0) {
break;
}
//
dataOut.writeByte(mode);
dataOut.writeInt(databaseID);
dataOut.writeLong(sessionID);
dataOut.writeLong(lobID);
dataOut.writeInt(LobResultTypes.REQUEST_SET_CHARS);
dataOut.writeLong(currentOffset);
dataOut.writeLong(byteArrayOS.size() / 2);
dataOut.write(byteArrayOS.getBuffer(), 0, byteArrayOS.size());
currentOffset += byteArrayOS.size() / 2;
if (byteArrayOS.size() < bufferLength) {
break;
}
}
}
示例5: writeBody
import org.hsqldb.lib.DataOutputStream; //导入方法依赖的package包/类
public void writeBody(DataOutputStream dataOut)
throws IOException {
dataOut.writeByte(mode);
dataOut.writeInt(databaseID);
dataOut.writeLong(sessionID);
dataOut.writeLong(lobID);
dataOut.writeInt(subType);
switch (subType) {
case LobResultTypes.REQUEST_CREATE_BYTES :
dataOut.writeLong(blockOffset);
dataOut.writeLong(blockLength);
dataOut.write(stream, blockLength);
break;
case LobResultTypes.REQUEST_CREATE_CHARS :
dataOut.writeLong(blockOffset);
dataOut.writeLong(blockLength);
dataOut.write(reader, blockLength);
break;
case LobResultTypes.REQUEST_SET_BYTES :
case LobResultTypes.REQUEST_GET_BYTE_PATTERN_POSITION :
dataOut.writeLong(blockOffset);
dataOut.writeLong(blockLength);
dataOut.write(byteBlock);
break;
case LobResultTypes.REQUEST_SET_CHARS :
case LobResultTypes.REQUEST_GET_CHAR_PATTERN_POSITION :
dataOut.writeLong(blockOffset);
dataOut.writeLong(blockLength);
dataOut.writeChars(charBlock);
break;
case LobResultTypes.REQUEST_GET_LOB :
//
case LobResultTypes.REQUEST_GET_BYTES :
case LobResultTypes.REQUEST_GET_CHARS :
dataOut.writeLong(blockOffset);
dataOut.writeLong(blockLength);
break;
case LobResultTypes.REQUEST_GET_LENGTH :
case LobResultTypes.REQUEST_TRUNCATE :
dataOut.writeLong(blockOffset);
break;
case LobResultTypes.RESPONSE_GET_BYTES :
dataOut.writeLong(blockOffset);
dataOut.writeLong(blockLength);
dataOut.write(byteBlock);
break;
case LobResultTypes.RESPONSE_GET_CHARS :
dataOut.writeLong(blockOffset);
dataOut.writeLong(blockLength);
dataOut.writeChars(charBlock);
break;
case LobResultTypes.RESPONSE_SET :
case LobResultTypes.RESPONSE_CREATE_BYTES :
case LobResultTypes.RESPONSE_CREATE_CHARS :
case LobResultTypes.RESPONSE_TRUNCATE :
dataOut.writeLong(blockLength);
break;
case LobResultTypes.RESPONSE_GET_BYTE_PATTERN_POSITION :
case LobResultTypes.RESPONSE_GET_CHAR_PATTERN_POSITION :
dataOut.writeLong(blockOffset);
break;
default :
throw Error.runtimeError(ErrorCode.U_S0500, "ResultLob");
}
}