|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object edu.mit.csail.aeolus.api.AeolusFileOutputStream
public class AeolusFileOutputStream
An Aeolus file output stream can be used for writing data to a given file.
The stream will only be created and opened if the requester labels allow writing to the file.
The file stream buffers all the writes. Closing the file stream causes data to be actually written to the file.
If the caller labels change and no longer allow the write, the stream will be closed and any data previously written to the stream will be written to the file.
Constructor Summary | |
---|---|
AeolusFileOutputStream(java.lang.String hostname,
java.lang.String filePath,
boolean appendMode)
Creates a filestream for writing to the file specified by filePath on hostname |
Method Summary | |
---|---|
void |
close()
Closes the file stream. |
void |
write(byte[] buffer)
Writes buffer.length bytes to the stream from the given buffer. |
void |
write(byte[] buffer,
int offset,
int count)
Writes count bytes into the stream from the buffer starting at the given offset. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public AeolusFileOutputStream(java.lang.String hostname, java.lang.String filePath, boolean appendMode) throws AeolusException, java.io.FileNotFoundException, java.io.IOException
hostname
- - node where the file is storedfilePath
- - path to the file on hostnameappendMode
- - if set to true, the bytes will be written to the end of the file
InfoFlowControlException
- - if caller labels don't allow writing to the file
or reading from a parent directory if the file is missing
java.io.FileNotFoundException
- - if the file does not exist on the hostname
AeolusException
- - if a FileSystemClient can not be created
java.io.IOException
- - if an I/O error occurs while opening the file stream
(e.g. when retrieving file labels)Method Detail |
---|
public void close() throws java.io.IOException, AeolusException
java.io.IOException
- - if an I/O error occurs while writing the data to the file
or the file is already closed
AeolusException
public void write(byte[] buffer) throws java.io.IOException, InfoFlowControlException, AeolusException
buffer
- - byte array storing the data to be written
java.io.IOException
- - if an I/O error occurred while writing to the stream
(e.g. the stream has been closed)
InfoFlowControlException
- - if caller labels no longer allow writing to the file
AeolusException
public void write(byte[] buffer, int offset, int count) throws java.io.IOException, InfoFlowControlException, AeolusException
java.io.IOException
- - if an I/O error occurred while writing to the stream
(e.g. the stream has been closed)
InfoFlowControlException
- - if caller labels no longer allow writing to the file
AeolusException
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |