org.mortbay.util
Class ByteArrayISO8859Writer

java.lang.Object
  |
  +--java.io.Writer
        |
        +--org.mortbay.util.ByteArrayISO8859Writer

public class ByteArrayISO8859Writer
extends java.io.Writer

Byte Array ISO 8859 writer. This class combines the features of a OutputStreamWriter for ISO8859 encoding with that of a ByteArrayOutputStream. It avoids many inefficiencies associated with these standard library classes. It has been optimized for standard ASCII characters.

Version:
$Revision: 1.11 $
Author:
Greg Wilkins (gregw)

Constructor Summary
ByteArrayISO8859Writer()
          Constructor.
ByteArrayISO8859Writer(byte[] buf)
           
ByteArrayISO8859Writer(int capacity)
          Constructor.
 
Method Summary
 int capacity()
           
 void close()
           
 void destroy()
           
 void ensureSpareCapacity(int n)
           
 void finalize()
           
 void flush()
           
 byte[] getBuf()
           
 byte[] getByteArray()
           
 java.lang.Object getLock()
           
 void resetWriter()
           
 void setLength(int l)
           
 int size()
           
 int spareCapacity()
           
 void write(char c)
           
 void write(char[] ca)
           
 void write(char[] ca, int offset, int length)
           
 void write(java.lang.String s)
           
 void write(java.lang.String s, int offset, int length)
           
 void writeTo(java.io.OutputStream out)
           
 
Methods inherited from class java.io.Writer
write
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ByteArrayISO8859Writer

public ByteArrayISO8859Writer()
Constructor.


ByteArrayISO8859Writer

public ByteArrayISO8859Writer(int capacity)
Constructor.

Parameters:
capacity - Buffer capacity

ByteArrayISO8859Writer

public ByteArrayISO8859Writer(byte[] buf)
Method Detail

getLock

public java.lang.Object getLock()

size

public int size()

capacity

public int capacity()

spareCapacity

public int spareCapacity()

setLength

public void setLength(int l)

getBuf

public byte[] getBuf()

writeTo

public void writeTo(java.io.OutputStream out)
             throws java.io.IOException
java.io.IOException

write

public void write(char c)
           throws java.io.IOException
java.io.IOException

write

public void write(char[] ca)
           throws java.io.IOException
Overrides:
write in class java.io.Writer
java.io.IOException

write

public void write(char[] ca,
                  int offset,
                  int length)
           throws java.io.IOException
Specified by:
write in class java.io.Writer
java.io.IOException

write

public void write(java.lang.String s)
           throws java.io.IOException
Overrides:
write in class java.io.Writer
java.io.IOException

write

public void write(java.lang.String s,
                  int offset,
                  int length)
           throws java.io.IOException
Overrides:
write in class java.io.Writer
java.io.IOException

flush

public void flush()
Specified by:
flush in class java.io.Writer

resetWriter

public void resetWriter()

close

public void close()
Specified by:
close in class java.io.Writer

destroy

public void destroy()

ensureSpareCapacity

public void ensureSpareCapacity(int n)
                         throws java.io.IOException
java.io.IOException

finalize

public void finalize()
Overrides:
finalize in class java.lang.Object

getByteArray

public byte[] getByteArray()


Copyright ? 2000 Mortbay Consulting Pty. Ltd. All Rights Reserved.