|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.fasterxml.jackson.core.io.SerializedString
public class SerializedString
String token that can lazily serialize String contained and then reuse that serialization later on. This is similar to JDBC prepared statements, for example, in that instances should only be created when they are used more than use; prime candidates are various serializers.
Class is final for performance reasons and since this is not designed to be extensible or customizable (customizations would occur in calling code)
| Field Summary | |
|---|---|
protected char[] |
_quotedChars
|
protected byte[] |
_quotedUTF8Ref
|
protected byte[] |
_unquotedUTF8Ref
|
protected String |
_value
|
| Constructor Summary | |
|---|---|
SerializedString(String v)
|
|
| Method Summary | |
|---|---|
int |
appendQuoted(char[] buffer,
int offset)
Method that will append quoted characters of this String into given buffer. |
int |
appendQuotedUTF8(byte[] buffer,
int offset)
Method that will append quoted UTF-8 bytes of this String into given buffer, if there is enough room; if not, returns -1. |
int |
appendUnquoted(char[] buffer,
int offset)
Method that will append unquoted characters of this String into given buffer. |
int |
appendUnquotedUTF8(byte[] buffer,
int offset)
Method that will append unquoted ('raw') UTF-8 bytes of this String into given buffer. |
char[] |
asQuotedChars()
Returns JSON quoted form of the String, as character array. |
byte[] |
asQuotedUTF8()
Accessor for accessing value as is (without JSON quoting) encoded using UTF-8 encoding. |
byte[] |
asUnquotedUTF8()
Accessor for accessing value that has been quoted using JSON quoting rules, and encoded using UTF-8 encoding. |
int |
charLength()
Returns length of the String as characters |
boolean |
equals(Object o)
|
String |
getValue()
Returns unquoted String that this object represents (and offers serialized forms for) |
int |
hashCode()
|
int |
putQuotedUTF8(ByteBuffer buffer)
|
int |
putUnquotedUTF8(ByteBuffer buffer)
|
String |
toString()
|
int |
writeQuotedUTF8(OutputStream out)
|
int |
writeUnquotedUTF8(OutputStream out)
|
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected final String _value
protected byte[] _quotedUTF8Ref
protected byte[] _unquotedUTF8Ref
protected char[] _quotedChars
| Constructor Detail |
|---|
public SerializedString(String v)
| Method Detail |
|---|
public final String getValue()
SerializableString
getValue in interface SerializableStringpublic final int charLength()
charLength in interface SerializableStringpublic final char[] asQuotedChars()
SerializableString
asQuotedChars in interface SerializableStringpublic final byte[] asUnquotedUTF8()
asUnquotedUTF8 in interface SerializableStringpublic final byte[] asQuotedUTF8()
asQuotedUTF8 in interface SerializableString
public int appendQuotedUTF8(byte[] buffer,
int offset)
SerializableStringbyte[] bytes = str.asQuotedUTF8(); System.arraycopy(bytes, 0, buffer, offset, bytes.length); return bytes.length;
appendQuotedUTF8 in interface SerializableString
public int appendQuoted(char[] buffer,
int offset)
SerializableStringchar[] ch = str.asQuotedChars(); System.arraycopy(ch, 0, buffer, offset, ch.length); return ch.length;
appendQuoted in interface SerializableString
public int appendUnquotedUTF8(byte[] buffer,
int offset)
SerializableStringbyte[] bytes = str.asUnquotedUTF8(); System.arraycopy(bytes, 0, buffer, offset, bytes.length); return bytes.length;
appendUnquotedUTF8 in interface SerializableString
public int appendUnquoted(char[] buffer,
int offset)
SerializableStringchar[] ch = str.getValue().toCharArray(); System.arraycopy(bytes, 0, buffer, offset, ch.length); return ch.length;
appendUnquoted in interface SerializableString
public int writeQuotedUTF8(OutputStream out)
throws IOException
writeQuotedUTF8 in interface SerializableStringIOException
public int writeUnquotedUTF8(OutputStream out)
throws IOException
writeUnquotedUTF8 in interface SerializableStringIOExceptionpublic int putQuotedUTF8(ByteBuffer buffer)
putQuotedUTF8 in interface SerializableStringpublic int putUnquotedUTF8(ByteBuffer buffer)
putUnquotedUTF8 in interface SerializableStringpublic final String toString()
toString in class Objectpublic final int hashCode()
hashCode in class Objectpublic final boolean equals(Object o)
equals in class Object
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||