public class InstrumentedFileWriter
extends java.io.FileWriter
| Modifier and Type | Field and Description |
|---|---|
private boolean |
inWrite1
Stores if we are in a write method with 1 parameter (avoid double
recording).
|
private boolean |
inWrite3
Stores if we are in a write 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 |
|---|
InstrumentedFileWriter(java.io.File file)
Constructs a file writer object given a File object.
|
InstrumentedFileWriter(java.io.File file,
boolean append)
Constructs a file writer object given a File object.
|
InstrumentedFileWriter(java.io.File file,
boolean append,
java.lang.String recId)
Constructs a file writer object given a File object.
|
InstrumentedFileWriter(java.io.FileDescriptor fdObj)
Constructs a FileWriter object associated with a file descriptor.
|
InstrumentedFileWriter(java.io.FileDescriptor fdObj,
java.lang.String recId)
Constructs a FileWriter object associated with a file descriptor.
|
InstrumentedFileWriter(java.io.File file,
java.lang.String recId)
Constructs a file writer object given a File object.
|
InstrumentedFileWriter(java.lang.String name)
Creates a file writer to write to the file with the
specified name.
|
InstrumentedFileWriter(java.lang.String name,
boolean append)
Constructs a file writer object given a file name with a boolean
indicating whether or not to append the data written.
|
InstrumentedFileWriter(java.lang.String name,
boolean append,
java.lang.String recId)
Constructs a file writer object given a file name with a boolean
indicating whether or not to append the data written.
|
InstrumentedFileWriter(java.lang.String name,
java.lang.String recId)
Creates a file writer to write to the file with the
specified name.
|
| Modifier and Type | Method and Description |
|---|---|
void |
write(char[] buffer)
Writes a data array.
|
void |
write(char[] buffer,
int off,
int len)
Writes a portion of a data array.
|
void |
write(int value)
Writes a char to the writer.
|
void |
write(java.lang.String str,
int off,
int len)
Writes a portion of a string.
|
private boolean inWrite3
private boolean inWrite1
private java.lang.String recId
public InstrumentedFileWriter(java.lang.String name)
throws java.io.IOException
FileDescriptor object is
created to represent this file connection.
If the file exists but is a directory rather than a regular file, does
not exist but cannot be created, or cannot be opened for any other
reason then a FileNotFoundException is thrown.
name - the system-dependent filenamejava.io.IOException - if the file exists but is a directory
rather than a regular file, does not exist but cannot
be created, or cannot be opened for any other reasonpublic InstrumentedFileWriter(java.lang.String name,
boolean append)
throws java.io.IOException
name - String The system-dependent filename.append - boolean if true, then data will be written
to the end of the file rather than the beginning.java.io.IOException - if the named file exists but is a directory rather
than a regular file, does not exist but cannot be
created, or cannot be opened for any other reasonpublic InstrumentedFileWriter(java.io.File file)
throws java.io.IOException
file - a File object to write to.java.io.IOException - if the file exists but is a directory rather than
a regular file, does not exist but cannot be created,
or cannot be opened for any other reasonpublic InstrumentedFileWriter(java.io.File file,
boolean append)
throws java.io.IOException
true, then bytes will be written to the end
of the file rather than the beginning.file - a File object to write toappend - if true, then bytes will be written
to the end of the file rather than the beginningjava.io.IOException - if the file exists but is a directory rather than
a regular file, does not exist but cannot be created,
or cannot be opened for any other reasonpublic InstrumentedFileWriter(java.io.FileDescriptor fdObj)
fdObj - FileDescriptor object to write to.public InstrumentedFileWriter(java.lang.String name,
java.lang.String recId)
throws java.io.IOException
FileDescriptor object is
created to represent this file connection.
If the file exists but is a directory rather than a regular file, does
not exist but cannot be created, or cannot be opened for any other
reason then a FileNotFoundException is thrown.
name - the system-dependent filenamerecId - the recorder id to aggregate the monitored data forjava.io.IOException - if the file exists but is a directory
rather than a regular file, does not exist but cannot
be created, or cannot be opened for any other reasonpublic InstrumentedFileWriter(java.lang.String name,
boolean append,
java.lang.String recId)
throws java.io.IOException
name - String The system-dependent filename.append - boolean if true, then data will be written
to the end of the file rather than the beginning.recId - the recorder id to aggregate the monitored data forjava.io.IOException - if the named file exists but is a directory rather
than a regular file, does not exist but cannot be
created, or cannot be opened for any other reasonpublic InstrumentedFileWriter(java.io.File file,
java.lang.String recId)
throws java.io.IOException
file - a File object to write to.recId - the recorder id to aggregate the monitored data forjava.io.IOException - if the file exists but is a directory rather than
a regular file, does not exist but cannot be created,
or cannot be opened for any other reasonpublic InstrumentedFileWriter(java.io.File file,
boolean append,
java.lang.String recId)
throws java.io.IOException
true, then bytes will be written to the end
of the file rather than the beginning.file - a File object to write toappend - if true, then bytes will be written
to the end of the file rather than the beginningrecId - the recorder id to aggregate the monitored data forjava.io.IOException - if the file exists but is a directory rather than
a regular file, does not exist but cannot be created,
or cannot be opened for any other reasonpublic InstrumentedFileWriter(java.io.FileDescriptor fdObj,
java.lang.String recId)
fdObj - FileDescriptor object to write to.recId - the recorder id to aggregate the monitored data forpublic void write(int value)
throws java.io.IOException
write in class java.io.OutputStreamWritervalue - the charjava.io.IOException - If an I/O error occurspublic void write(char[] buffer)
throws java.io.IOException
write in class java.io.Writerbuffer - the data arrayjava.io.IOException - If an I/O error occurspublic void write(char[] buffer,
int off,
int len)
throws java.io.IOException
write in class java.io.OutputStreamWriterbuffer - the data arrayoff - Offset from which to start writing characterslen - Number of characters to writejava.io.IOException - If an I/O error occurspublic void write(java.lang.String str,
int off,
int len)
throws java.io.IOException
write in class java.io.OutputStreamWriterstr - A Stringoff - Offset from which to start writing characterslen - Number of characters to writejava.io.IOException - If an I/O error occurs