org.apache.jackrabbit.util
Class LazyFileInputStream

java.lang.Object
  extended byjava.io.InputStream
      extended byorg.apache.jackrabbit.util.LazyFileInputStream

public class LazyFileInputStream
extends InputStream

This Class implements an InputStream that provides the same functionality as a FileInputStream but opens the file by the first file access.


Constructor Summary
LazyFileInputStream(File file)
          Creates a new LazyFileInputStream for the given file.
LazyFileInputStream(FileDescriptor fdObj)
          Creates a new LazyFileInputStream for the given file desciptor.
LazyFileInputStream(String name)
          Creates a new LazyFileInputStream for the given file.
 
Method Summary
 int available()
          
 void close()
          
 void mark(int readlimit)
          
 boolean markSupported()
          
 void open()
          Opens the underlying file input stream in neccessairy.
 int read()
          
 int read(byte[] b)
          
 int read(byte[] b, int off, int len)
          
 void reset()
          
 long skip(long n)
          
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LazyFileInputStream

public LazyFileInputStream(File file)
                    throws FileNotFoundException
Creates a new LazyFileInputStream for the given file. If the file is unreadably, a FileNotFoundException is thrown.

Parameters:
file -
Throws:
FileNotFoundException

LazyFileInputStream

public LazyFileInputStream(FileDescriptor fdObj)
Creates a new LazyFileInputStream for the given file desciptor.

Parameters:
fdObj -

LazyFileInputStream

public LazyFileInputStream(String name)
                    throws FileNotFoundException
Creates a new LazyFileInputStream for the given file. If the file is unreadably, a FileNotFoundException is thrown.

Parameters:
name -
Throws:
FileNotFoundException
Method Detail

open

public void open()
          throws IOException
Opens the underlying file input stream in neccessairy.

Throws:
IOException

read

public int read()
         throws IOException

Throws:
IOException

available

public int available()
              throws IOException

Throws:
IOException

close

public void close()
           throws IOException

Throws:
IOException

reset

public void reset()
           throws IOException

Throws:
IOException

markSupported

public boolean markSupported()


mark

public void mark(int readlimit)


skip

public long skip(long n)
          throws IOException

Throws:
IOException

read

public int read(byte[] b)
         throws IOException

Throws:
IOException

read

public int read(byte[] b,
                int off,
                int len)
         throws IOException

Throws:
IOException


Copyright © 2004-2006 The Apache Software Foundation. All Rights Reserved.