com.sun.xfile
Class XFileOutputStream

java.lang.Object
  |
  +--java.io.OutputStream
        |
        +--com.sun.xfile.XFileOutputStream

public class XFileOutputStream
extends java.io.OutputStream

An XFile output stream is an output stream for writing data to an XFile.


Constructor Summary
XFileOutputStream(java.lang.String name)
          Creates an output XFile stream to write to the file with the specified name.
XFileOutputStream(java.lang.String name, boolean append)
          Creates an output file with the specified name or URL.
XFileOutputStream(XFile xfile)
          Creates an XFile output stream to write to the specified XFile object.
XFileOutputStream(XFile xfile, boolean append)
          Creates an output file for the specified XFile object.
 
Method Summary
 void close()
          Closes this file output stream, flushes any buffered, unwritten data, and releases any system resources associated with this stream.
 void flush()
          Flushes this output stream and forces any buffered output bytes to be written out.
 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 XFile output stream.
 void write(int b)
          Writes the specified byte to this file output stream.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XFileOutputStream

public XFileOutputStream(XFile xfile)
                  throws java.io.IOException
Creates an XFile output stream to write to the specified XFile object.
Parameters:
file - the XFile to be opened for writing.
Throws:
java.io.IOException - if the XFile could not be opened for writing.

XFileOutputStream

public XFileOutputStream(java.lang.String name)
                  throws java.io.IOException
Creates an output XFile stream to write to the file with the specified name.
Parameters:
name - the system-dependent filename.
Throws:
java.io.IOException - if the file could not be opened for writing.

XFileOutputStream

public XFileOutputStream(XFile xfile,
                         boolean append)
                  throws java.io.IOException
Creates an output file for the specified XFile object.
Parameters:
xfile - the XFile to be opened for writing.
append - true if writes begin at the end of the file
Throws:
java.io.IOException - If the file is not found.

XFileOutputStream

public XFileOutputStream(java.lang.String name,
                         boolean append)
                  throws java.io.IOException
Creates an output file with the specified name or URL.
Parameters:
name - the native name or URL
append - true if writes begin at the end of the file
Throws:
java.io.IOException - If the file is not found.
Method Detail

write

public void write(int b)
           throws java.io.IOException
Writes the specified byte to this file output stream.
Parameters:
b - the byte to be written.
Throws:
java.io.IOException - if an I/O error occurs.
Overrides:
write in class java.io.OutputStream

write

public void write(byte[] b)
           throws java.io.IOException
Writes b.length bytes from the specified byte array to this file output stream.
Parameters:
b - the data.
Throws:
java.io.IOException - if an I/O error occurs.
Overrides:
write in class java.io.OutputStream

write

public void write(byte[] b,
                  int off,
                  int len)
           throws java.io.IOException
Writes len bytes from the specified byte array starting at offset off to this XFile output stream.
Parameters:
b - the data.
off - the start offset in the data.
len - the number of bytes to write.
Throws:
java.io.IOException - if an I/O error occurs.
Overrides:
write in class java.io.OutputStream

flush

public void flush()
           throws java.io.IOException
Flushes this output stream and forces any buffered output bytes to be written out.

Throws:
java.io.IOException - if an I/O error occurs.
Overrides:
flush in class java.io.OutputStream

close

public void close()
           throws java.io.IOException
Closes this file output stream, flushes any buffered, unwritten data, and releases any system resources associated with this stream. After the file is closed further I/O operations may throw IOException.
Throws:
java.io.IOException - if an I/O error occurs.
Overrides:
close in class java.io.OutputStream