com.pega.pegarules.pub.util
Class PRWriterCompressor

java.lang.Object
  extended by java.io.Writer
      extended by com.pega.pegarules.pub.util.PRWriterCompressor
All Implemented Interfaces:
java.io.Closeable, java.io.Flushable, java.lang.Appendable

public class PRWriterCompressor
extends java.io.Writer

PRWriterCompressor is an enhanced version of PRWriter that allows for a GZIP stream to be written at the same time as the regular stream.

Version:
$Revision: 2 $
Author:
Jim Gajnak

Field Summary
static java.lang.String COPYRIGHT
           
static java.lang.String VERSION
           
 
Constructor Summary
PRWriterCompressor(java.io.File aFile, java.io.File aGZIPFile, java.lang.String aEncoding)
          Deprecated.  
PRWriterCompressor(java.io.OutputStream aOutStream, java.io.OutputStream aSecondaryStream, java.lang.String aEncoding)
          Creates a new PRWriterCompressor from the specified OutputStreams.
PRWriterCompressor(PRFile aFile, PRFile aGZIPFile, java.lang.String aEncoding)
          Deprecated.  
PRWriterCompressor(java.lang.String aFilePathName, java.lang.String aGZIPFilePathName, java.lang.String aEncoding)
          Create a file, and optionally, a corresponding GZIP output file
 
Method Summary
 void close()
          Close the stream.
 void flush()
          Flush the stream.
 void write(char[] aCbuf, int aOff, int aLen)
          Write a portion of an array of characters.
 
Methods inherited from class java.io.Writer
append, append, append, write, write, write, write
 
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

PRWriterCompressor

public PRWriterCompressor(java.io.OutputStream aOutStream,
                          java.io.OutputStream aSecondaryStream,
                          java.lang.String aEncoding)
                   throws java.io.UnsupportedEncodingException,
                          java.io.IOException
Creates a new PRWriterCompressor from the specified OutputStreams.

Parameters:
aOutStream - The output stream
aEncoding - The encoding type to use. See PRFileUtil.ENCODING_* types
aSecondaryStream - The secondary output stream to be writtent to.
Throws:
java.io.UnsupportedEncodingException
java.io.IOException

PRWriterCompressor

public PRWriterCompressor(java.io.File aFile,
                          java.io.File aGZIPFile,
                          java.lang.String aEncoding)
                   throws java.io.FileNotFoundException,
                          java.io.UnsupportedEncodingException,
                          java.io.IOException
Deprecated. 

Creates a new PRWriter from the specified aFile.

Parameters:
aFile - The file
aGZIPFile - if you want a gzip version written as well.
aEncoding - The encoding type to use. See PRFileUtil.ENCODING_* types
Throws:
java.io.FileNotFoundException
java.io.UnsupportedEncodingException
java.io.IOException

PRWriterCompressor

public PRWriterCompressor(PRFile aFile,
                          PRFile aGZIPFile,
                          java.lang.String aEncoding)
                   throws java.io.FileNotFoundException,
                          java.io.UnsupportedEncodingException,
                          java.io.IOException
Deprecated. 

Creates a new PRWriter from the specified aFile.

Parameters:
aFile - The file
aGZIPFile - PRFile if you want a gzip version written as well.
aEncoding - The encoding type to use. See PRFileUtil.ENCODING_* types
Throws:
java.io.FileNotFoundException
java.io.UnsupportedEncodingException
java.io.IOException

PRWriterCompressor

public PRWriterCompressor(java.lang.String aFilePathName,
                          java.lang.String aGZIPFilePathName,
                          java.lang.String aEncoding)
                   throws java.io.FileNotFoundException,
                          java.io.UnsupportedEncodingException,
                          java.io.IOException
Create a file, and optionally, a corresponding GZIP output file

Parameters:
aFilePathName -
aGZIPFilePathName -
aEncoding -
Throws:
java.io.FileNotFoundException
java.io.UnsupportedEncodingException
java.io.IOException
Method Detail

close

public void close()
           throws java.io.IOException
Close the stream. Identical to OutputStreamWriter.close()

Specified by:
close in interface java.io.Closeable
Specified by:
close in class java.io.Writer
Throws:
java.io.IOException
See Also:
OutputStreamWriter.close()

flush

public void flush()
           throws java.io.IOException
Flush the stream. Identical to OutputStreamWriter.flush()

Specified by:
flush in interface java.io.Flushable
Specified by:
flush in class java.io.Writer
Throws:
java.io.IOException
See Also:
OutputStreamWriter.flush()

write

public void write(char[] aCbuf,
                  int aOff,
                  int aLen)
           throws java.io.IOException
Write a portion of an array of characters. Identical to OutputStreamWriter.write(char[], int, int)

Specified by:
write in class java.io.Writer
Parameters:
aCbuf - Buffer of characters
aOff - Offset from which to start writing characters
aLen - Number of characters to write
Throws:
java.io.IOException - If an I/O error occurs
See Also:
OutputStreamWriter.write(char[], int, int)


Copyright © 2012 Pegasystems Inc. All Rights Reserved.