|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjava.io.OutputStream
edu.sdsc.grid.io.GeneralFileOutputStream
edu.sdsc.grid.io.local.LocalFileOutputStream
public class LocalFileOutputStream
A LocalFileOutputStream writes bytes to a file in a file system. What files are available depends on the host environment.
LocalFileOutputStream is meant for writing streams of raw bytes such as image data.
Basically just wraps java.io.FileOuputStream.
| Field Summary |
|---|
| Fields inherited from class edu.sdsc.grid.io.GeneralFileOutputStream |
|---|
fd |
| Constructor Summary | |
|---|---|
LocalFileOutputStream(LocalFile file)
Creates a LocalFileOutputStream by
opening a connection to an actual file,
the file named by the LocalFile
object file in the file system. |
|
LocalFileOutputStream(java.lang.String name)
Creates a LocalFileOutputStream by
opening a connection to an actual file,
the file named by the path name name
in the file system. |
|
| Method Summary | |
|---|---|
void |
close()
Closes this file output stream and releases any system resources associated with this stream. |
protected void |
finalize()
Ensures that the close method of this file input stream is
called when there are no more references to it. |
protected void |
open(GeneralFile file)
Opens the given file for use by 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, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public LocalFileOutputStream(java.lang.String name)
throws java.io.IOException
LocalFileOutputStream by
opening a connection to an actual file,
the file named by the path name name
in the file system.
First, the security is checked to verify the file can be written.
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
IOException is thrown.
name - the system-dependent file name.
java.io.IOException - 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 LocalFileOutputStream(LocalFile file)
throws java.io.IOException
LocalFileOutputStream by
opening a connection to an actual file,
the file named by the LocalFile
object file in the file system.
A new FileDescriptor object
is created to represent this file connection.
First, the security is checked to verify the file can be written.
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
IOException is thrown.
file - the file to be opened for reading.
java.io.IOException - if the file does not exist,
is a directory rather than a regular file,
or for some other reason cannot be opened for
reading.File.getPath()| Method Detail |
|---|
protected void finalize()
throws java.io.IOException
close method of this file input stream is
called when there are no more references to it.
finalize in class GeneralFileOutputStreamjava.io.IOException - if an I/O error occurs.edu.sdsc.grid.io.LocalFileOutputStream#close()
protected void open(GeneralFile file)
throws java.io.IOException
open in class GeneralFileOutputStreamfile - the file to be opened.
java.io.IOException - if an I/O error occurs.
public void write(int b)
throws java.io.IOException
write method of OutputStream.
write in class GeneralFileOutputStreamb - the byte to be written.
java.io.IOException - if an I/O error occurs.
public void write(byte[] b)
throws java.io.IOException
b.length bytes from the specified byte array
to this file output stream.
write in class GeneralFileOutputStreamb - the data.
java.io.IOException - if an I/O error occurs.
public void write(byte[] b,
int off,
int len)
throws java.io.IOException
len bytes from the specified byte array
starting at offset off to this file output stream.
write in class GeneralFileOutputStreamb - the data.off - the start offset in the data.len - the number of bytes to write.
java.io.IOException - if an I/O error occurs.
public void close()
throws java.io.IOException
If this stream has an associated channel then the channel is closed as well.
close in interface java.io.Closeableclose in class GeneralFileOutputStreamjava.io.IOException - if an I/O error occurs.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||