bloboutputstream.java

来自「用Java写的面相对象的数据库管理系统」· Java 代码 · 共 66 行

JAVA
66
字号
// You can redistribute this software and/or modify it under the terms of// the Ozone Library License version 1 published by ozone-db.org.//// The original code and portions created by SMB are// Copyright (C) 1997-2000 by SMB GmbH. All rights reserved.//// $Id: BLOBOutputStream.java,v 1.3 2000/10/28 16:55:16 daniela Exp $package org.ozoneDB.blob;import org.ozoneDB.*;import java.io.*;/** * The output stream of ozone BLOBs. Every write operations will call * the underlaying BLOBContainer. Therefore BLOBStreams should never be used * without buffering/caching. This can be done by using the BLOBStream together * with a BufferedStream. *  *  * @author <a href="http://www.softwarebuero.de/">SMB</a> * @version $Revision: 1.3 $Date: 2000/10/28 16:55:16 $ */public class BLOBOutputStream extends OutputStream implements Serializable {        BLOBContainer container;    int index = 0;            public BLOBOutputStream( BLOBContainer _container ) {        container = _container;    }            public void write( byte[] b ) throws IOException {        write( b, 0, b.length );    }             public void write( byte[] b, int off, int len ) throws IOException {        try {            container.write( index, b, off, len );            index += len;        } catch (Exception e) {            e.printStackTrace();            throw new IOException( e.getMessage() );        }     }             public void write( int b ) throws IOException {        byte[] bb = new byte[1];        bb[0] = (byte)b;        write( bb, 0, 1 );    }             public void flush() throws IOException {    }             public void close() throws IOException {    } }

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?