public class InstrumentedFileOutputStream
extends java.io.FileOutputStream
| 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 |
|---|
InstrumentedFileOutputStream(java.io.File file)
Creates a file output stream to write to the file represented by
the specified
File object. |
InstrumentedFileOutputStream(java.io.File file,
boolean append)
Creates a file output stream to write to the file represented by
the specified
File object. |
InstrumentedFileOutputStream(java.io.File file,
boolean append,
java.lang.String recId)
Creates a file output stream to write to the file represented by
the specified
File object. |
InstrumentedFileOutputStream(java.io.FileDescriptor fdObj)
Creates an output file stream to write to the specified file
descriptor, which represents an existing connection to an actual
file in the file system.
|
InstrumentedFileOutputStream(java.io.FileDescriptor fdObj,
java.lang.String recId)
Creates an output file stream to write to the specified file
descriptor, which represents an existing connection to an actual
file in the file system.
|
InstrumentedFileOutputStream(java.io.File file,
java.lang.String recId)
Creates a file output stream to write to the file represented by
the specified
File object. |
InstrumentedFileOutputStream(java.lang.String name)
Creates an output file stream to write to the file with the
specified name.
|
InstrumentedFileOutputStream(java.lang.String name,
boolean append)
Creates an output file stream to write to the file with the specified
name. |
InstrumentedFileOutputStream(java.lang.String name,
boolean append,
java.lang.String recId)
Creates an output file stream to write to the file with the specified
name. |
InstrumentedFileOutputStream(java.lang.String name,
java.lang.String recId)
Creates an output file stream to write to the file with the
specified name.
|
| Modifier and Type | Method and Description |
|---|---|
void |
write(byte[] buffer)
Writes a data array.
|
void |
write(byte[] buffer,
int off,
int len)
Writes a portion of a data array.
|
void |
write(int value)
Writes a byte to the stream.
|
private boolean inWrite3
private boolean inWrite1
private java.lang.String recId
public InstrumentedFileOutputStream(java.lang.String name)
throws java.io.FileNotFoundException
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.FileNotFoundException - 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 InstrumentedFileOutputStream(java.lang.String name,
boolean append)
throws java.io.FileNotFoundException
name. If the second argument is true, then
bytes will be written to the end of the file rather than the beginning.
A new 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 file nameappend - if true, then bytes will be written
to the end of the file rather than the beginningjava.io.FileNotFoundException - 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.public InstrumentedFileOutputStream(java.io.File file)
throws java.io.FileNotFoundException
File object. A new
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.
file - the file to be opened for writing.java.io.FileNotFoundException - 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 InstrumentedFileOutputStream(java.io.File file,
boolean append)
throws java.io.FileNotFoundException
File object. If the second argument is
true, then bytes will be written to the end of the file
rather than the beginning. A new 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.
file - the file to be opened for writing.append - if true, then bytes will be written
to the end of the file rather than the beginningjava.io.FileNotFoundException - 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 InstrumentedFileOutputStream(java.io.FileDescriptor fdObj)
fdObj - the file descriptor to be opened for writingpublic InstrumentedFileOutputStream(java.lang.String name,
java.lang.String recId)
throws java.io.FileNotFoundException
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.FileNotFoundException - 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 InstrumentedFileOutputStream(java.lang.String name,
boolean append,
java.lang.String recId)
throws java.io.FileNotFoundException
name. If the second argument is true, then
bytes will be written to the end of the file rather than the beginning.
A new 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 file nameappend - 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.FileNotFoundException - 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.public InstrumentedFileOutputStream(java.io.File file,
java.lang.String recId)
throws java.io.FileNotFoundException
File object. A new
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.
file - the file to be opened for writing.recId - the recorder id to aggregate the monitored data forjava.io.FileNotFoundException - 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 InstrumentedFileOutputStream(java.io.File file,
boolean append,
java.lang.String recId)
throws java.io.FileNotFoundException
File object. If the second argument is
true, then bytes will be written to the end of the file
rather than the beginning. A new 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.
file - the file to be opened for writing.append - 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.FileNotFoundException - 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 InstrumentedFileOutputStream(java.io.FileDescriptor fdObj,
java.lang.String recId)
fdObj - the file descriptor to be opened for writingrecId - the recorder id to aggregate the monitored data forpublic void write(int value)
throws java.io.IOException
write in class java.io.FileOutputStreamvalue - the data bytejava.io.IOException - If an I/O error occurspublic void write(byte[] buffer)
throws java.io.IOException
write in class java.io.FileOutputStreambuffer - the data arrayjava.io.IOException - If an I/O error occurspublic void write(byte[] buffer,
int off,
int len)
throws java.io.IOException
write in class java.io.FileOutputStreambuffer - the data arrayoff - Offset from which to start writing characterslen - Number of characters to writejava.io.IOException - If an I/O error occurs