public class InstrumentedFileReader
extends java.io.FileReader
| Modifier and Type | Field and Description |
|---|---|
private boolean |
inRead1
Stores if we are in a read method with 1 parameter (avoid double
recording).
|
private boolean |
inRead3
Stores if we are in a read method with 3 parameters (avoid double
recording).
|
private java.lang.String |
recId
Stores the recorder id to aggregate the monitored data for.
|
| Constructor and Description |
|---|
InstrumentedFileReader(java.io.File file)
Creates a file reader by
opening a connection to an actual file,
the file named by the
File
object file in the file system. |
InstrumentedFileReader(java.io.FileDescriptor fdObj)
Creates a file input stream by using the file descriptor
fdObj, which represents an existing connection to an
actual file in the file system. |
InstrumentedFileReader(java.io.FileDescriptor fdObj,
java.lang.String recId)
Creates a file input stream by using the file descriptor
fdObj, which represents an existing connection to an
actual file in the file system. |
InstrumentedFileReader(java.io.File file,
java.lang.String recId)
Creates a file reader by
opening a connection to an actual file,
the file named by the
File
object file in the file system. |
InstrumentedFileReader(java.lang.String name)
Creates a file reader by
opening a connection to an actual file,
the file named by the path name
name
in the file system. |
InstrumentedFileReader(java.lang.String name,
java.lang.String recId)
Creates a file reader by
opening a connection to an actual file,
the file named by the path name
name
in the file system. |
| Modifier and Type | Method and Description |
|---|---|
int |
read()
Reads a char from a stream.
|
int |
read(char[] buffer)
Reads chars into
buffer, at maximum up to the length of the
buffer. |
int |
read(char[] buffer,
int off,
int len)
Reads at maximum
len chars into buffer starting
at off. |
private boolean inRead3
private boolean inRead1
private java.lang.String recId
public InstrumentedFileReader(java.lang.String name)
throws java.io.FileNotFoundException
name
in the file system.
If the named file does not exist, is a directory rather than a regular
file, or for some other reason cannot be opened for reading then a
FileNotFoundException is thrown.
name - the system-dependent file name.java.io.FileNotFoundException - if the file does not exist,
is a directory rather than a regular file,
or for some other reason cannot be opened for
reading.public InstrumentedFileReader(java.io.File file)
throws java.io.FileNotFoundException
File
object file in the file system.
If the named file does not exist, is a directory rather than a regular
file, or for some other reason cannot be opened for reading then a
FileNotFoundException is thrown.
file - the file to be opened for reading.java.io.FileNotFoundException - if the file does not exist,
is a directory rather than a regular file,
or for some other reason cannot be opened for
reading.public InstrumentedFileReader(java.io.FileDescriptor fdObj)
fdObj, which represents an existing connection to an
actual file in the file system.
If fdObj is null then a NullPointerException
is thrown.
fdObj - the file descriptor to be opened for reading.public InstrumentedFileReader(java.lang.String name,
java.lang.String recId)
throws java.io.FileNotFoundException
name
in the file system.
If the named file does not exist, is a directory rather than a regular
file, or for some other reason cannot be opened for reading then a
FileNotFoundException is thrown.
name - the system-dependent file name.recId - the recorder id to aggregate the monitored data forjava.io.FileNotFoundException - if the file does not exist,
is a directory rather than a regular file,
or for some other reason cannot be opened for
reading.public InstrumentedFileReader(java.io.File file,
java.lang.String recId)
throws java.io.FileNotFoundException
File
object file in the file system.
If the named file does not exist, is a directory rather than a regular
file, or for some other reason cannot be opened for reading then a
FileNotFoundException is thrown.
file - the file to be opened for reading.recId - the recorder id to aggregate the monitored data forjava.io.FileNotFoundException - if the file does not exist,
is a directory rather than a regular file,
or for some other reason cannot be opened for
reading.public InstrumentedFileReader(java.io.FileDescriptor fdObj,
java.lang.String recId)
fdObj, which represents an existing connection to an
actual file in the file system.
If fdObj is null then a NullPointerException
is thrown.
fdObj - the file descriptor to be opened for reading.recId - the recorder id to aggregate the monitored data forpublic int read()
throws java.io.IOException
read in class java.io.InputStreamReaderjava.io.IOException - in case of any I/O error or problempublic int read(char[] buffer)
throws java.io.IOException
buffer, at maximum up to the length of the
buffer.read in class java.io.Readerbuffer - the char buffer to be modifiedjava.io.IOException - in case of I/O reading errorspublic int read(char[] buffer,
int off,
int len)
throws java.io.IOException
len chars into buffer starting
at off.read in class java.io.InputStreamReaderbuffer - the char buffer to be modifiedoff - the offset where to start storing byteslen - the maximum number of bytes to be read (less than length of
b)java.io.IOException - in case of I/O reading errors