⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 bloboutputstream.java

📁 Java的面向对象数据库系统的源代码
💻 JAVA
字号:
// 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-@year@ by SMB GmbH. All rights reserved.
//
// $Id: BLOBOutputStream.java,v 1.3 2002/12/29 11:15:55 per_nyfelt Exp $

package org.ozoneDB.blob;

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: 2002/12/29 11:15:55 $
 */
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 + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -