|
JAFS API v2 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.io.OutputStream | +--org.openafs.jafs.FileOutputStream
This class is a file output stream for files within AFS.
It is an output stream for writing data to a
.
File
File
,
FileInputStream
,
FileOutputStream
Constructor Summary | |
FileOutputStream(File file)
Creates a file output stream to write to the AFS file represented by the specified File object.
|
|
FileOutputStream(File file,
boolean append)
Creates a file output stream to write to the AFS file represented by the specified File object.
|
|
FileOutputStream(String name)
Creates an output file stream to write to the AFS file with the specified name. |
|
FileOutputStream(String name,
boolean append)
Creates an output file stream to write to the AFS file with the specified name . |
Method Summary | |
void |
close()
Closes this file output stream and releases any system resources associated with this stream. |
void |
write(byte[] b)
Writes b.length bytes from the specified byte array
to this file output stream.
|
void |
write(byte[] b,
int off,
int len)
Writes len bytes from the specified
byte array starting at offset off to
this file output stream. |
void |
write(int b)
Writes the specified byte to this file output stream.
|
Methods inherited from class java.io.OutputStream |
flush |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public FileOutputStream(String name) throws AFSFileException
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 AFSFileException
is thrown.
name
- the name of the file to write to
AFSFileException
- If an AFS specific error occurs,
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, including
authorization.public FileOutputStream(String name, boolean append) throws AFSFileException
name
. If the second argument is true
, then
bytes will be written to the end of the file rather than the beginning.
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 AFSFileException
is thrown.
name
- the name of the file to write toappend
- if true
, then bytes will be written
to the end of the file rather than the beginning
AFSFileException
- If an AFS specific error occurs,
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, including
authorization.public FileOutputStream(File file) throws AFSFileException
File
object.
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 AFSFileException
is thrown.
file
- the AFS file to be opened for writing.
AFSFileException
- If an AFS specific error occurs,
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, including
authorization.File.getPath()
public FileOutputStream(File file, boolean append) throws AFSFileException
File
object.
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 AFSFileException
is thrown.
file
- the AFS file to be opened for writing.append
- if true
, then bytes will be written
to the end of the file rather than the beginning
AFSFileException
- If an AFS specific error occurs,
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, including
authorization.File.getPath()
Method Detail |
public void write(int b) throws AFSFileException
byte
to this file output stream.
Implements the abstract write method of OutputStream.
write
in class OutputStream
b
- the byte to be written.
AFSFileException
- if an error occurs.public void write(byte[] b) throws AFSFileException
b.length
bytes from the specified byte array
to this file output stream.
Implements the write
method of three arguments with the
arguments b
, 0
, and
b.length
.
Note that this method does not call the one-argument
write
method of its underlying stream with the single
argument b
.
write
in class OutputStream
b
- the data to be written.
AFSFileException
- if an error occurs.write(byte[], int, int)
,
FilterOutputStream.write(byte[], int, int)
public void write(byte[] b, int off, int len) throws AFSFileException
len
bytes from the specified
byte
array starting at offset off
to
this file output stream.
write
in class OutputStream
b
- the data to be writtenoff
- the start offset in the datalen
- the number of bytes that are written
AFSFileException
- if an I/O or other file related error occurs.FilterOutputStream.write(int)
public void close() throws AFSFileException
close
in class OutputStream
AFSFileException
- if an I/O or other file related error occurs.
|
JAFS API v2 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |