Package org.eclipse.jetty.util
Class ByteArrayISO8859Writer
java.lang.Object
java.io.Writer
org.eclipse.jetty.util.ByteArrayISO8859Writer
- All Implemented Interfaces:
Closeable,Flushable,Appendable,AutoCloseable
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.
-
Field Summary
-
Constructor Summary
ConstructorsConstructorDescriptionConstructor.ByteArrayISO8859Writer(byte[] buf) ByteArrayISO8859Writer(int capacity) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionintcapacity()voidclose()voiddestroy()voidensureSpareCapacity(int n) voidflush()byte[]getBuf()byte[]getLock()voidvoidsetLength(int l) intsize()intvoidwrite(char c) voidwrite(char[] ca) voidwrite(char[] ca, int offset, int length) voidvoidvoidwriteTo(OutputStream out)
-
Constructor Details
-
ByteArrayISO8859Writer
public ByteArrayISO8859Writer()Constructor. -
ByteArrayISO8859Writer
public ByteArrayISO8859Writer(int capacity) Constructor.- Parameters:
capacity- Buffer capacity
-
ByteArrayISO8859Writer
public ByteArrayISO8859Writer(byte[] buf)
-
-
Method Details
-
getLock
-
size
public int size() -
capacity
public int capacity() -
spareCapacity
public int spareCapacity() -
setLength
public void setLength(int l) -
getBuf
public byte[] getBuf() -
writeTo
- Throws:
IOException
-
write
- Throws:
IOException
-
write
- Overrides:
writein classWriter- Throws:
IOException
-
write
- Specified by:
writein classWriter- Throws:
IOException
-
write
- Overrides:
writein classWriter- Throws:
IOException
-
write
- Overrides:
writein classWriter- Throws:
IOException
-
flush
public void flush() -
resetWriter
public void resetWriter() -
close
public void close() -
destroy
public void destroy() -
ensureSpareCapacity
- Throws:
IOException
-
getByteArray
public byte[] getByteArray()
-