| java.lang.Object com.sun.xml.bind.v2.runtime.output.Encoded
Encoded | final public class Encoded (Code) | | 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 | |
public byte[] | buf | public int | len |
Method Summary | |
public void | append(char b) Appends a new character to the end of the buffer. | public void | compact() Reallocate the buffer to the exact size of the data
to reduce the memory footprint. | public void | ensureSize(int size) | final public void | set(String text) | final public void | setEscape(String text, boolean isAttribute) | final public void | write(UTF8XmlOutput out) Writes the encoded bytes to the given output stream. |
append | public void append(char b)(Code) | | Appends a new character to the end of the buffer.
This assumes that you have enough space in the buffer.
|
compact | public void compact()(Code) | | Reallocate the buffer to the exact size of the data
to reduce the memory footprint.
|
ensureSize | public void ensureSize(int size)(Code) | | |
setEscape | final public void setEscape(String text, boolean isAttribute)(Code) | | 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. |
|
|