本文整理汇总了Java中org.hsqldb.lib.HsqlByteArrayOutputStream.write方法的典型用法代码示例。如果您正苦于以下问题:Java HsqlByteArrayOutputStream.write方法的具体用法?Java HsqlByteArrayOutputStream.write怎么用?Java HsqlByteArrayOutputStream.write使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.hsqldb.lib.HsqlByteArrayOutputStream
的用法示例。
在下文中一共展示了HsqlByteArrayOutputStream.write方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: clearRowImage
import org.hsqldb.lib.HsqlByteArrayOutputStream; //导入方法依赖的package包/类
private void clearRowImage(CachedObject row) {
try {
int length = row.getStorageSize();
int count = length - textFileSettings.bytesForLineEnd.length;
rowOut.reset();
HsqlByteArrayOutputStream out = rowOut.getOutputStream();
for (; count > 0; count -= textFileSettings.bytesForSpace.length) {
out.write(textFileSettings.bytesForSpace);
}
out.write(textFileSettings.bytesForLineEnd);
dataFile.seek(row.getPos());
dataFile.write(out.getBuffer(), 0, out.size());
} catch (Throwable t) {
throw Error.runtimeError(ErrorCode.U_S0500, t.getMessage());
}
}
示例2: clearRowImage
import org.hsqldb.lib.HsqlByteArrayOutputStream; //导入方法依赖的package包/类
private void clearRowImage(CachedObject row) {
try {
int length = row.getStorageSize()
- ScriptWriterText.BYTES_LINE_SEP.length;
rowOut.reset();
HsqlByteArrayOutputStream out = rowOut.getOutputStream();
out.fill(' ', length);
out.write(ScriptWriterText.BYTES_LINE_SEP);
dataFile.seek(row.getPos());
dataFile.write(out.getBuffer(), 0, out.size());
} catch (IOException e) {
throw Error.runtimeError(ErrorCode.U_S0500, e.getMessage());
}
}
示例3: clearRowImage
import org.hsqldb.lib.HsqlByteArrayOutputStream; //导入方法依赖的package包/类
private void clearRowImage(CachedObject row) {
try {
int length = row.getStorageSize()
- ScriptWriterText.BYTES_LINE_SEP.length;
rowOut.reset();
HsqlByteArrayOutputStream out = rowOut.getOutputStream();
out.fill(' ', length);
out.write(ScriptWriterText.BYTES_LINE_SEP);
dataFile.seek(row.getPos());
dataFile.write(out.getBuffer(), 0, out.size());
} catch (Throwable t) {
throw Error.runtimeError(ErrorCode.U_S0500, t.getMessage());
}
}
示例4: free
import org.hsqldb.lib.HsqlByteArrayOutputStream; //导入方法依赖的package包/类
/**
*
*/
void free(CachedRow r) throws HsqlException {
if (storeOnInsert &&!isIndexingSource) {
int pos = r.iPos;
int length = r.storageSize
- ScriptWriterText.BYTES_LINE_SEP.length;
rowOut.reset();
HsqlByteArrayOutputStream out = rowOut.getOutputStream();
try {
out.fill(' ', length);
out.write(ScriptWriterText.BYTES_LINE_SEP);
dataFile.seek(pos);
dataFile.write(out.getBuffer(), 0, out.size());
} catch (IOException e) {
throw (Trace.error(Trace.FILE_IO_ERROR, e.toString()));
}
}
remove(r);
}
示例5: allocateBlobSegments
import org.hsqldb.lib.HsqlByteArrayOutputStream; //导入方法依赖的package包/类
private void allocateBlobSegments(ResultLob result,
InputStream stream) throws IOException {
//
long currentOffset = result.getOffset();
int bufferLength = session.getStreamBlockSize();
HsqlByteArrayOutputStream byteArrayOS =
new HsqlByteArrayOutputStream(bufferLength);
while (true) {
byteArrayOS.reset();
byteArrayOS.write(stream, bufferLength);
byte[] byteArray = byteArrayOS.getBuffer();
Result actionResult =
database.lobManager.setBytes(result.getLobID(), currentOffset,
byteArray, byteArrayOS.size());
currentOffset += byteArrayOS.size();
if (byteArrayOS.size() < bufferLength) {
return;
}
}
}
示例6: allocateBlobSegments
import org.hsqldb.lib.HsqlByteArrayOutputStream; //导入方法依赖的package包/类
private void allocateBlobSegments(ResultLob result,
InputStream stream) throws IOException {
//
long currentOffset = result.getOffset();
int bufferLength = session.getStreamBlockSize();
HsqlByteArrayOutputStream byteArrayOS =
new HsqlByteArrayOutputStream(bufferLength);
while (true) {
byteArrayOS.reset();
byteArrayOS.write(stream, bufferLength);
if (byteArrayOS.size() == 0) {
return;
}
byte[] byteArray = byteArrayOS.getBuffer();
Result actionResult =
database.lobManager.setBytes(result.getLobID(), currentOffset,
byteArray, byteArrayOS.size());
// FIXME: actionResult not used anymore!?
currentOffset += byteArrayOS.size();
if (byteArrayOS.size() < bufferLength) {
return;
}
}
}
示例7: allocateBlobSegments
import org.hsqldb.lib.HsqlByteArrayOutputStream; //导入方法依赖的package包/类
private void allocateBlobSegments(ResultLob result,
InputStream stream) throws IOException {
//
long currentOffset = result.getOffset();
int bufferLength = session.getStreamBlockSize();
HsqlByteArrayOutputStream byteArrayOS =
new HsqlByteArrayOutputStream(bufferLength);
while (true) {
byteArrayOS.reset();
byteArrayOS.write(stream, bufferLength);
if (byteArrayOS.size() == 0) {
return;
}
byte[] byteArray = byteArrayOS.getBuffer();
Result actionResult =
database.lobManager.setBytes(result.getLobID(), currentOffset,
byteArray, byteArrayOS.size());
currentOffset += byteArrayOS.size();
if (byteArrayOS.size() < bufferLength) {
return;
}
}
}
示例8: clearRowImage
import org.hsqldb.lib.HsqlByteArrayOutputStream; //导入方法依赖的package包/类
private void clearRowImage(CachedObject row) throws IOException {
int length = row.getStorageSize()
- ScriptWriterText.BYTES_LINE_SEP.length;
rowOut.reset();
HsqlByteArrayOutputStream out = rowOut.getOutputStream();
out.fill(' ', length);
out.write(ScriptWriterText.BYTES_LINE_SEP);
dataFile.seek(row.getPos());
dataFile.write(out.getBuffer(), 0, out.size());
}
示例9: writeCreateByteSegments
import org.hsqldb.lib.HsqlByteArrayOutputStream; //导入方法依赖的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;
}
}
}
示例10: writeCreateCharSegments
import org.hsqldb.lib.HsqlByteArrayOutputStream; //导入方法依赖的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;
}
}
}