com.pega.pegarules.pub.util
Class PROutputStream

java.lang.Object
  extended by java.io.OutputStream
      extended by com.pega.pegarules.pub.util.PROutputStream
All Implemented Interfaces:
java.io.Closeable, java.io.Flushable

public class PROutputStream
extends java.io.OutputStream

Implementation of OutputStream that writes to a JDBC data store.

Version:
$Revision: 2 $
Author:
dassu

Field Summary
static java.lang.String COPYRIGHT
           
static java.lang.String VERSION
           
 
Constructor Summary
PROutputStream(PRFile aFile)
          Creates a new instance of PROutputStream to write file contents to the underlying file store.
PROutputStream(PRFile aFile, boolean aAppend)
          Creates a new instance of PROutputStream to write file contents to the underlying file store.
PROutputStream(java.lang.String aFileSpec)
          Creates a new instance of PROutputStream to write file contents to the underlying file store.
PROutputStream(java.lang.String aFileSpec, boolean aAppend)
          Creates a new instance of PROutputStream to write file contents to the underlying file store.
 
Method Summary
 void close()
          Closes this output stream and writes the contents of the file to the underlying file storage.
 void write(byte[] b)
          Write the specified byte to this output stream.
 void write(byte[] b, int off, int len)
          Write a portion of an array of bytes.
 void write(int b)
          Write the specified byte to this output stream.
 
Methods inherited from class java.io.OutputStream
flush
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

COPYRIGHT

public static final java.lang.String COPYRIGHT
See Also:
Constant Field Values

VERSION

public static final java.lang.String VERSION
Constructor Detail

PROutputStream

public PROutputStream(java.lang.String aFileSpec)
               throws java.io.IOException
Creates a new instance of PROutputStream to write file contents to the underlying file store.

Parameters:
aFileSpec - URL specification for the file to be opened for writing
Throws:
java.io.IOException

PROutputStream

public PROutputStream(java.lang.String aFileSpec,
                      boolean aAppend)
               throws java.io.IOException
Creates a new instance of PROutputStream to write file contents to the underlying file store.

Parameters:
aFileSpec - URL specification for the file to be opened for writing
aAppend - if true, then bytes will be written to the end of the file rather than the beginning
Throws:
java.io.IOException

PROutputStream

public PROutputStream(PRFile aFile)
               throws java.io.IOException
Creates a new instance of PROutputStream to write file contents to the underlying file store.

Parameters:
aFile - the file to be opened for writing
Throws:
java.io.IOException

PROutputStream

public PROutputStream(PRFile aFile,
                      boolean aAppend)
               throws java.io.IOException
Creates a new instance of PROutputStream to write file contents to the underlying file store.

Parameters:
aFile - the file to be opened for writing.
aAppend - if true, then bytes will be written to the end of the file rather than the beginning
Throws:
java.io.IOException
Method Detail

write

public void write(int b)
           throws java.io.IOException
Write the specified byte to this output stream. Identical to ByteArrayOutputStream.write(int)

Specified by:
write in class java.io.OutputStream
Parameters:
b - the byte to be written
Throws:
java.io.IOException - If an I/O error occurs
See Also:
ByteArrayOutputStream.write(int)

write

public void write(byte[] b)
           throws java.io.IOException
Write the specified byte to this output stream. Identical to ByteArrayOutputStream.write(byte[])

Overrides:
write in class java.io.OutputStream
Parameters:
b - Buffer of characters
Throws:
java.io.IOException - If an I/O error occurs
See Also:
OutputStream.write(byte[])

write

public void write(byte[] b,
                  int off,
                  int len)
           throws java.io.IOException
Write a portion of an array of bytes. Identical to ByteArrayOutputStream.write(byte[], int, int)

Overrides:
write in class java.io.OutputStream
Parameters:
b - Buffer of bytes
off - Offset from which to start writing characters
len - Number of characters to write
Throws:
java.io.IOException - If an I/O error occurs
See Also:
ByteArrayOutputStream.write(byte[], int, int)

close

public void close()
           throws java.io.IOException
Closes this output stream and writes the contents of the file to the underlying file storage. MUST call this method for the file contents to be written out to the storage device.

Specified by:
close in interface java.io.Closeable
Overrides:
close in class java.io.OutputStream
Throws:
java.io.IOException


Copyright © 2012 Pegasystems Inc. All Rights Reserved.