Class Encoded
java.lang.Object
com.sun.xml.bind.v2.runtime.output.Encoded
Buffer for UTF-8 encoded string.
See http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8 for the UTF-8 encoding.
- Author:
- Kohsuke Kawaguchi
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidappend(char b) Appends a new character to the end of the buffer.voidcompact()Reallocate the buffer to the exact size of the data to reduce the memory footprint.voidensureSize(int size) final voidfinal voidFill in the buffer by encoding the specified characters while escaping characters like <final voidwrite(UTF8XmlOutput out) Writes the encoded bytes to the given output stream.
-
Field Details
-
buf
public byte[] buf -
len
public int len
-
-
Constructor Details
-
Encoded
public Encoded() -
Encoded
-
-
Method Details
-
ensureSize
public void ensureSize(int size) -
set
-
setEscape
Fill in the buffer by encoding the specified characters while escaping characters like <- Parameters:
isAttribute- if true, characters like \t, \r, and \n are also escaped.
-
write
Writes the encoded bytes to the given output stream.- Throws:
IOException
-
append
public void append(char b) Appends a new character to the end of the buffer. This assumes that you have enough space in the buffer. -
compact
public void compact()Reallocate the buffer to the exact size of the data to reduce the memory footprint.
-