当前位置: 首页>>代码示例>>Java>>正文


Java HsqlByteArrayOutputStream.size方法代码示例

本文整理汇总了Java中org.hsqldb.lib.HsqlByteArrayOutputStream.size方法的典型用法代码示例。如果您正苦于以下问题:Java HsqlByteArrayOutputStream.size方法的具体用法?Java HsqlByteArrayOutputStream.size怎么用?Java HsqlByteArrayOutputStream.size使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.hsqldb.lib.HsqlByteArrayOutputStream的用法示例。


在下文中一共展示了HsqlByteArrayOutputStream.size方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: 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;
        }
    }
}
 
开发者ID:RabadanLab,项目名称:Pegasus,代码行数:26,代码来源:SessionData.java

示例2: 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;
        }
    }
}
 
开发者ID:tiweGH,项目名称:OpenDiabetes,代码行数:31,代码来源:SessionData.java

示例3: 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;
        }
    }
}
 
开发者ID:Julien35,项目名称:dev-courses,代码行数:30,代码来源:SessionData.java

示例4: 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;
        }
    }
}
 
开发者ID:tiweGH,项目名称:OpenDiabetes,代码行数:56,代码来源:ResultLob.java

示例5: 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;
        }
    }
}
 
开发者ID:tiweGH,项目名称:OpenDiabetes,代码行数:58,代码来源:ResultLob.java


注:本文中的org.hsqldb.lib.HsqlByteArrayOutputStream.size方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。