1*c3ab0d6aSAndrew Rist /************************************************************** 2*c3ab0d6aSAndrew Rist * 3*c3ab0d6aSAndrew Rist * Licensed to the Apache Software Foundation (ASF) under one 4*c3ab0d6aSAndrew Rist * or more contributor license agreements. See the NOTICE file 5*c3ab0d6aSAndrew Rist * distributed with this work for additional information 6*c3ab0d6aSAndrew Rist * regarding copyright ownership. The ASF licenses this file 7*c3ab0d6aSAndrew Rist * to you under the Apache License, Version 2.0 (the 8*c3ab0d6aSAndrew Rist * "License"); you may not use this file except in compliance 9*c3ab0d6aSAndrew Rist * with the License. You may obtain a copy of the License at 10*c3ab0d6aSAndrew Rist * 11*c3ab0d6aSAndrew Rist * http://www.apache.org/licenses/LICENSE-2.0 12*c3ab0d6aSAndrew Rist * 13*c3ab0d6aSAndrew Rist * Unless required by applicable law or agreed to in writing, 14*c3ab0d6aSAndrew Rist * software distributed under the License is distributed on an 15*c3ab0d6aSAndrew Rist * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16*c3ab0d6aSAndrew Rist * KIND, either express or implied. See the License for the 17*c3ab0d6aSAndrew Rist * specific language governing permissions and limitations 18*c3ab0d6aSAndrew Rist * under the License. 19*c3ab0d6aSAndrew Rist * 20*c3ab0d6aSAndrew Rist *************************************************************/ 21*c3ab0d6aSAndrew Rist 22cdf0e10cSrcweir /* 23cdf0e10cSrcweir * NativeOutputStreamHelper.java 24cdf0e10cSrcweir * 25cdf0e10cSrcweir * Created on 1. September 2004, 10:39 26cdf0e10cSrcweir */ 27cdf0e10cSrcweir 28cdf0e10cSrcweir package com.sun.star.sdbcx.comp.hsqldb; 29cdf0e10cSrcweir 30cdf0e10cSrcweir /** 31cdf0e10cSrcweir * 32cdf0e10cSrcweir * @author oj93728 33cdf0e10cSrcweir */ 34cdf0e10cSrcweir public class NativeOutputStreamHelper extends java.io.OutputStream{ 35cdf0e10cSrcweir 36cdf0e10cSrcweir private String key; 37cdf0e10cSrcweir private String file; 38cdf0e10cSrcweir private StorageNativeOutputStream out; 39cdf0e10cSrcweir /** Creates a new instance of NativeOutputStreamHelper */ NativeOutputStreamHelper(String key,String _file)40cdf0e10cSrcweir public NativeOutputStreamHelper(String key,String _file) { 41cdf0e10cSrcweir file = _file; 42cdf0e10cSrcweir this.key = key; 43cdf0e10cSrcweir out = new StorageNativeOutputStream(file,key); 44cdf0e10cSrcweir } 45cdf0e10cSrcweir write(byte[] b, int off, int len)46cdf0e10cSrcweir public void write(byte[] b, int off, int len) throws java.io.IOException{ 47cdf0e10cSrcweir out.write(key,file,b, off, len); 48cdf0e10cSrcweir } 49cdf0e10cSrcweir write(byte[] b)50cdf0e10cSrcweir public void write(byte[] b) throws java.io.IOException{ 51cdf0e10cSrcweir out.write(key,file,b); 52cdf0e10cSrcweir } 53cdf0e10cSrcweir close()54cdf0e10cSrcweir public void close() throws java.io.IOException{ 55cdf0e10cSrcweir out.close(key,file); 56cdf0e10cSrcweir } 57cdf0e10cSrcweir write(int b)58cdf0e10cSrcweir public void write(int b) throws java.io.IOException{ 59cdf0e10cSrcweir out.write(key,file,b); 60cdf0e10cSrcweir } 61cdf0e10cSrcweir flush()62cdf0e10cSrcweir public void flush() throws java.io.IOException{ 63cdf0e10cSrcweir out.flush(key,file); 64cdf0e10cSrcweir } 65cdf0e10cSrcweir sync()66cdf0e10cSrcweir public void sync() throws java.io.IOException{ 67cdf0e10cSrcweir out.sync(key,file); 68cdf0e10cSrcweir } 69cdf0e10cSrcweir } 70