Main Page   Namespace List   Class Hierarchy   Compound List   File List   Compound Members  

stdbase::io::FileInputStream Class Reference

An input stream class that reads data from files. More...

Inheritance diagram for stdbase::io::FileInputStream::

stdbase::system::Object stdbase::io::InputStream List of all members.

Public Methods

virtual int available () throw (IOException)
 Get the number of bytes that can be read or skipped before the next read would block.

virtual void close () throw (IOException)
 Closes the stream and releases any resources.

virtual void mark (int readlimit)
 Marks the current position in the input stream incase the caller need return to this point - done by calling reset(). More...

virtual void reset () throw (IOException)
 Returns the caller to a previously marked position in the input stream (if supported). More...

virtual bool markSupported ()
 Test to see whether the FileInputStream implementation supports the mark()/reset() methods.

virtual int read (byte buffer[], int len) throw (IOException)
 Read a buffer of bytes - NEEDS Array.

virtual int read () throw (IOException)
 Read a single byte from the stream and return it as an integer. More...

virtual long skip (long n) throw (IOException)
 Skip the next n bytes from the input stream. More...


Static Public Methods

system::reference< FileInputStream > create (system::StringRef name)
 Creates a FileInputStream when given a file name as a String object.

system::reference< FileInputStream > create (const system::platform::FileDescriptor &fd)
 Create a FileInputStream given a FileDescriptor object.


Protected Methods

 FileInputStream (::stdbase::system::StringRef name)
 Constructor taking a filename as a StringRef. More...

 FileInputStream (const::stdbase::system::platform::FileDescriptor &fd)
 Constructor taking an open file descriptor for reading - most typically for stdin.

virtual ~FileInputStream ()
 Destructor.


Detailed Description

An input stream class that reads data from files.

Definition at line 51 of file FileInputStream.


Constructor & Destructor Documentation

stdbase::io::FileInputStream::FileInputStream ::stdbase::system::StringRef name [protected]
 

Constructor taking a filename as a StringRef.

Attempts to open the file for reading.

Definition at line 240 of file FileInputStream.cpp.

Referenced by create().


Member Function Documentation

void stdbase::io::FileInputStream::mark int readlimit [virtual]
 

Marks the current position in the input stream incase the caller need return to this point - done by calling reset().

Parameters:
readlimit   the maximum limit of bytes before the marked position becomes invalid.

Reimplemented from stdbase::io::InputStream.

Definition at line 85 of file FileInputStream.cpp.

int stdbase::io::FileInputStream::read throw (IOException) [virtual]
 

Read a single byte from the stream and return it as an integer.

Returns:
the number of bytes read.

Reimplemented from stdbase::io::InputStream.

Definition at line 173 of file FileInputStream.cpp.

void stdbase::io::FileInputStream::reset throw (IOException) [virtual]
 

Returns the caller to a previously marked position in the input stream (if supported).

Exceptions:
IOException   if mark/reset not supported or if the number of bytes read exceeds the mark readlimit when mark() was called.

Reimplemented from stdbase::io::InputStream.

Definition at line 90 of file FileInputStream.cpp.

long stdbase::io::FileInputStream::skip long n throw (IOException) [virtual]
 

Skip the next n bytes from the input stream.

Returns:
the number of bytes skipped.

Reimplemented from stdbase::io::InputStream.

Definition at line 208 of file FileInputStream.cpp.


The documentation for this class was generated from the following files:
Generated at Tue Aug 13 14:19:40 2002 for stdnet2 by doxygen1.2.9.1 written by Dimitri van Heesch, © 1997-2001