com.pega.pegarules.pub.util
Class PRWriter

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

public class PRWriter
extends java.io.Writer

PRWriter is thin wrapper around java.io.Writer and simply attempts to write out the byte order marks for UTF-8 if that is indeed the encoding to be used to write to the stream.

Version:
$Revision: 2 $
Author:
dassu

Field Summary
static java.lang.String COPYRIGHT
          copyright
static java.lang.String VERSION
          version id
 
Constructor Summary
PRWriter(java.io.File aFile, java.lang.String aEncoding)
          Deprecated.  
PRWriter(java.io.OutputStream aOutStream, java.lang.String aEncoding)
          Creates a new PRWriter from the specified OutputStream.
PRWriter(PRFile aFile, java.lang.String aEncoding)
           
PRWriter(java.lang.String aFileSpec, java.lang.String aEncoding)
          Creates a new PRWriter from the specified aFilePathName.
 
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
copyright

See Also:
Constant Field Values

VERSION

public static final java.lang.String VERSION
version id

Constructor Detail

PRWriter

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

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

PRWriter

public PRWriter(java.io.File aFile,
                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
aEncoding - The encoding type to use. See PRFileUtil.ENCODING_* types
Throws:
java.io.FileNotFoundException
java.io.UnsupportedEncodingException
java.io.IOException

PRWriter

public PRWriter(PRFile aFile,
                java.lang.String aEncoding)
         throws java.io.FileNotFoundException,
                java.io.UnsupportedEncodingException,
                java.io.IOException
Throws:
java.io.FileNotFoundException
java.io.UnsupportedEncodingException
java.io.IOException

PRWriter

public PRWriter(java.lang.String aFileSpec,
                java.lang.String aEncoding)
         throws java.io.FileNotFoundException,
                java.io.UnsupportedEncodingException,
                java.io.IOException
Creates a new PRWriter from the specified aFilePathName.

Parameters:
aFileSpec - The URL specification for the file
aEncoding - The encoding type to use. See PRFileUtil.ENCODING_* types
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.