com.plumtree.openfoundation.io
Class XPFileOutputStream

java.lang.Object
  extended bycom.plumtree.openfoundation.io.XPOutputStream
      extended bycom.plumtree.openfoundation.io.XPFileOutputStream

public class XPFileOutputStream
extends XPOutputStream

XPFileOutputStream corresponds to java.io.FileOutputStream or System.IO.FileStream.


Constructor Summary
XPFileOutputStream(java.io.FileOutputStream fileStream)
          Wrap the platform local equivalent in a new XPFileOutputStream.
XPFileOutputStream(java.lang.String fileName)
          Creates a new XPFileOutputStream object by opening a connection to an actual file named by the filename.
XPFileOutputStream(java.lang.String fileName, boolean append)
          Creates a new XPFileOutputStream object by opening a connection to an actual file named by the filename.
 
Method Summary
 void Close()
          Close the underlying stream.
 void Flush()
          Flush the underlying stream.
 java.io.OutputStream GetUnderlyingObject()
          Return a reference to the underyling stream.
 void Write(byte[] buffer)
          Write an array of bytes to the underlying output stream.
 void Write(byte[] buffer, int offset, int count)
          Write out part of a byte array to the underlying output stream.
 void Write(int b)
          Writes the specified byte to this output stream.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XPFileOutputStream

public XPFileOutputStream(java.io.FileOutputStream fileStream)
Wrap the platform local equivalent in a new XPFileOutputStream.

Parameters:
fileStream - a FileOutputStream object

XPFileOutputStream

public XPFileOutputStream(java.lang.String fileName)
Creates a new XPFileOutputStream object by opening a connection to an actual file named by the filename.

Parameters:
fileName - the system-dependent file name

XPFileOutputStream

public XPFileOutputStream(java.lang.String fileName,
                          boolean append)
Creates a new XPFileOutputStream object by opening a connection to an actual file named by the filename. If the second argument is true, then bytes will be written to the end of the file rather than the beginning.

Parameters:
fileName - the system-dependent file name
append - if true, then bytes will be written to the end of the file rather than the beginning
Method Detail

Close

public void Close()
Close the underlying stream.

Overrides:
Close in class XPOutputStream

Flush

public void Flush()
Flush the underlying stream.

Overrides:
Flush in class XPOutputStream

Write

public void Write(int b)
Description copied from class: XPOutputStream
Writes the specified byte to this output stream.

Overrides:
Write in class XPOutputStream
Parameters:
b - the byte.

Write

public void Write(byte[] buffer)
Write an array of bytes to the underlying output stream.

Overrides:
Write in class XPOutputStream
Parameters:
buffer - the data.

Write

public void Write(byte[] buffer,
                  int offset,
                  int count)
Write out part of a byte array to the underlying output stream.

Overrides:
Write in class XPOutputStream
Parameters:
buffer - the data.
offset - the start offset in the data.
count - the number of bytes to write.

GetUnderlyingObject

public java.io.OutputStream GetUnderlyingObject()
Return a reference to the underyling stream.

Overrides:
GetUnderlyingObject in class XPOutputStream
Returns:
OutputStream A OutputStream object.


Copyright 2002, 2003, 2004 Plumtree Software Inc. All Rights Reserved.