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
ConstructorDescriptionConstructor.ByteArrayISO8859Writer
(byte[] buf) ByteArrayISO8859Writer
(int capacity) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionint
capacity()
void
close()
void
destroy()
void
ensureSpareCapacity
(int n) void
flush()
byte[]
getBuf()
byte[]
getLock()
void
void
setLength
(int l) int
size()
int
void
write
(char c) void
write
(char[] ca) void
write
(char[] ca, int offset, int length) void
void
void
writeTo
(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:
write
in classWriter
- Throws:
IOException
-
write
- Specified by:
write
in classWriter
- Throws:
IOException
-
write
- Overrides:
write
in classWriter
- Throws:
IOException
-
write
- Overrides:
write
in 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()
-