1*c3ab0d6aSAndrew Rist /************************************************************** 2cdf0e10cSrcweir * 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 10cdf0e10cSrcweir * 11*c3ab0d6aSAndrew Rist * http://www.apache.org/licenses/LICENSE-2.0 12cdf0e10cSrcweir * 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. 19cdf0e10cSrcweir * 20*c3ab0d6aSAndrew Rist *************************************************************/ 21*c3ab0d6aSAndrew Rist 22*c3ab0d6aSAndrew Rist 23cdf0e10cSrcweir /* 24cdf0e10cSrcweir * NativeInputStreamHelper.java 25cdf0e10cSrcweir * 26cdf0e10cSrcweir * Created on 9. September 2004, 11:51 27cdf0e10cSrcweir */ 28cdf0e10cSrcweir 29cdf0e10cSrcweir package com.sun.star.sdbcx.comp.hsqldb; 30cdf0e10cSrcweir 31cdf0e10cSrcweir /** 32cdf0e10cSrcweir * 33cdf0e10cSrcweir * @author Ocke 34cdf0e10cSrcweir */ 35cdf0e10cSrcweir public class NativeInputStreamHelper extends java.io.InputStream{ 36cdf0e10cSrcweir private String key; 37cdf0e10cSrcweir private String file; 38cdf0e10cSrcweir private StorageNativeInputStream in; 39cdf0e10cSrcweir /** Creates a new instance of NativeInputStreamHelper */ NativeInputStreamHelper(String key,String _file)40cdf0e10cSrcweir public NativeInputStreamHelper(String key,String _file) { 41cdf0e10cSrcweir file = _file; 42cdf0e10cSrcweir this.key = key; 43cdf0e10cSrcweir in = new StorageNativeInputStream(key,file); 44cdf0e10cSrcweir } 45cdf0e10cSrcweir read()46cdf0e10cSrcweir public int read() throws java.io.IOException { 47cdf0e10cSrcweir return in.read(key,file); 48cdf0e10cSrcweir } 49cdf0e10cSrcweir read(byte[] b, int off, int len)50cdf0e10cSrcweir public int read(byte[] b, int off, int len) throws java.io.IOException { 51cdf0e10cSrcweir return in.read(key,file,b,off,len); 52cdf0e10cSrcweir } 53cdf0e10cSrcweir close()54cdf0e10cSrcweir public void close() throws java.io.IOException { 55cdf0e10cSrcweir in.close(key,file); 56cdf0e10cSrcweir } 57cdf0e10cSrcweir skip(long n)58cdf0e10cSrcweir public long skip(long n) throws java.io.IOException { 59cdf0e10cSrcweir return in.skip(key,file,n); 60cdf0e10cSrcweir } 61cdf0e10cSrcweir available()62cdf0e10cSrcweir public int available() throws java.io.IOException { 63cdf0e10cSrcweir return in.available(key,file); 64cdf0e10cSrcweir } 65cdf0e10cSrcweir read(byte[] b)66cdf0e10cSrcweir public int read(byte[] b) throws java.io.IOException { 67cdf0e10cSrcweir return in.read(key,file,b); 68cdf0e10cSrcweir } 69cdf0e10cSrcweir 70cdf0e10cSrcweir } 71