bloboutputstream.java
来自「Java的面向对象数据库系统的源代码」· Java 代码 · 共 65 行
JAVA
65 行
// 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 + =
减小字号Ctrl + -
显示快捷键?