org.norther.tammi.acorn.io
Class FileInputStream

java.lang.Object
  extended by java.io.InputStream
      extended by java.io.FilterInputStream
          extended by java.io.BufferedInputStream
              extended by org.norther.tammi.acorn.io.UnicodeInputStream
                  extended by org.norther.tammi.acorn.io.FileInputStream
All Implemented Interfaces:
Closeable

public class FileInputStream
extends UnicodeInputStream

A buffered file input stream.

Author:
Ilkka Priha

Field Summary
 
Fields inherited from class java.io.BufferedInputStream
buf, count, marklimit, markpos, pos
 
Fields inherited from class java.io.FilterInputStream
in
 
Constructor Summary
FileInputStream(File file)
          Constructs a new stream for a file.
FileInputStream(FileDescriptor fdObj)
          Constructs a new stream for a file descriptor.
FileInputStream(FileDescriptor fdObj, String enc)
          Constructs a new stream for a file descriptor with an encoding check.
FileInputStream(File file, String enc)
          Constructs a new stream for a file with an encoding check.
FileInputStream(String name)
          Constructs a new stream for a named file.
FileInputStream(String name, String enc)
          Constructs a new stream for a named file with an encoding check.
 
Method Summary
 void close()
           
protected  void finalize()
           
 FileChannel getChannel()
          Gets file channel of this stream.
 FileDescriptor getFD()
          Gets file descriptor of this stream.
 String getPath()
          Gets file path of this stream.
 
Methods inherited from class org.norther.tammi.acorn.io.UnicodeInputStream
getEncoding, read, read, skip
 
Methods inherited from class java.io.BufferedInputStream
available, mark, markSupported, reset
 
Methods inherited from class java.io.FilterInputStream
read
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FileInputStream

public FileInputStream(File file)
                throws FileNotFoundException
Constructs a new stream for a file.

Parameters:
file - the file.
Throws:
FileNotFoundException - if not found.

FileInputStream

public FileInputStream(FileDescriptor fdObj)
Constructs a new stream for a file descriptor.

Parameters:
fdObj - the file descriptor.

FileInputStream

public FileInputStream(String name)
                throws FileNotFoundException
Constructs a new stream for a named file.

Parameters:
name - the file name.
Throws:
FileNotFoundException - if not found.

FileInputStream

public FileInputStream(File file,
                       String enc)
                throws FileNotFoundException,
                       IOException
Constructs a new stream for a file with an encoding check.

Parameters:
file - the file.
enc - an optional default encoding.
Throws:
FileNotFoundException - if not found.
IOException - on I/O errors.

FileInputStream

public FileInputStream(FileDescriptor fdObj,
                       String enc)
                throws IOException
Constructs a new stream for a file descriptor with an encoding check.

Parameters:
fdObj - the file descriptor.
enc - an optional default encoding.
Throws:
IOException - on I/O errors.

FileInputStream

public FileInputStream(String name,
                       String enc)
                throws FileNotFoundException,
                       IOException
Constructs a new stream for a named file with an encoding check.

Parameters:
name - the file name.
enc - an optional default encoding.
Throws:
FileNotFoundException - if not found.
IOException - on I/O errors.
Method Detail

close

public void close()
           throws IOException
Specified by:
close in interface Closeable
Overrides:
close in class UnicodeInputStream
Throws:
IOException

getFD

public final FileDescriptor getFD()
                           throws IOException
Gets file descriptor of this stream.

Returns:
the file descriptor.
Throws:
IOException - on I/O errors.

getChannel

public FileChannel getChannel()
Gets file channel of this stream.

Returns:
the file channel.

getPath

public String getPath()
Gets file path of this stream.

Returns:
the path or null.

finalize

protected void finalize()
Overrides:
finalize in class Object


Copyright © 2004 The Norther Organization. All rights reserved.