public class TKVSerializer
extends java.lang.Object
Constructor | Description |
---|---|
TKVSerializer() |
Modifier and Type | Method | Description |
---|---|---|
static KeyValueCollection |
deserialize(byte[] bytes) |
Deprecated.
use according method with additional encoding parameter
|
static KeyValueCollection |
deserialize(byte[] bytes,
boolean getLen) |
Deprecated.
use according method with additional encoding parameter
|
static KeyValueCollection |
deserialize(byte[] bytes,
java.lang.String encoding) |
Unpacks TKV list from byte array.
|
static KeyValueCollection |
deserialize(byte[] bytes,
java.lang.String encoding,
boolean getLen) |
Unpacks TKV list from byte array.
|
static KeyValueCollection |
deserialize(byte[] bytes,
java.lang.String encoding,
int offset,
int length,
boolean readLen) |
Unpacks TKV list from byte array.
|
static KeyValueCollection |
deserialize(java.io.InputStream in) |
Reads packed TKV list from
OutputStream and unpacks it. |
static KeyValueCollection |
deserialize(java.io.InputStream in,
java.lang.String encoding,
boolean readLen) |
Reads packed TKV list from
OutputStream and unpacks it. |
static byte[] |
getBytes(KeyValueCollection list) |
Packs the list and returns it as byte array.
|
static byte[] |
getBytes(KVList list,
boolean useUtfString,
java.lang.String encoding) |
Packs the list and returns it as byte array.
|
static byte[] |
getBytes(KVList list,
boolean useUtfString,
java.lang.String encoding,
boolean useLen) |
Packs the list and returns it as byte array.
|
static byte[] |
getBytes(KVList list,
java.lang.String encoding) |
Deprecated.
|
static byte[] |
getBytes(KVList list,
java.lang.String encoding,
boolean useLen) |
Deprecated.
|
static void |
serialize(KVList list,
java.io.OutputStream out) |
Packs the list and writes it to
OutputStream . |
static void |
serialize(KVList list,
java.io.OutputStream out,
java.lang.String encoding,
boolean writeLen) |
Packs the list and writes it to
OutputStream . |
public static KeyValueCollection deserialize(java.io.InputStream in) throws java.io.IOException, DataFormatException
OutputStream
and unpacks it.
To create strings from bytes uses platform default encoding.in
- the stream to read list fromjava.io.IOException
- if some IO problems occurDataFormatException
- if stream is invalidpublic static KeyValueCollection deserialize(java.io.InputStream in, java.lang.String encoding, boolean readLen) throws java.io.IOException, DataFormatException
OutputStream
and unpacks it.
To create strings from bytes uses supplied encoding. If encoding is
null than default platform encoding will be used.in
- the stream to read list fromencoding
- the encoding for byte to string conversionreadLen
- if true - length bytes are expectedjava.io.IOException
- if some IO problems occurDataFormatException
- if byte array is invalid@Deprecated public static KeyValueCollection deserialize(byte[] bytes) throws DataFormatException
bytes
- bytes to unpack list fromDataFormatException
- if byte array is invaliddeserialize(byte[], String)
@Deprecated public static KeyValueCollection deserialize(byte[] bytes, boolean getLen) throws DataFormatException
bytes
- bytes to unpack list fromgetLen
- if true - length bytes are expectedDataFormatException
- if byte array is invaliddeserialize(byte[], String, boolean)
public static KeyValueCollection deserialize(byte[] bytes, java.lang.String encoding) throws DataFormatException, java.io.UnsupportedEncodingException
bytes
- bytes to unpack list fromencoding
- the encoding for byte to string conversionDataFormatException
- if byte array is invalidjava.io.UnsupportedEncodingException
- if encoding is unsupportedpublic static KeyValueCollection deserialize(byte[] bytes, java.lang.String encoding, boolean getLen) throws DataFormatException, java.io.UnsupportedEncodingException
bytes
- bytes to unpack list fromencoding
- the encoding for byte to string conversiongetLen
- if true - length bytes are expectedDataFormatException
- if byte array is invalidjava.io.UnsupportedEncodingException
- if encoding is unsupportedpublic static KeyValueCollection deserialize(byte[] bytes, java.lang.String encoding, int offset, int length, boolean readLen) throws DataFormatException, java.io.UnsupportedEncodingException
bytes
- bytes to unpack list fromencoding
- the encoding for byte to string conversionoffset
- offset in array to read fromlength
- number of bytes to readreadLen
- if true - length bytes are expectedDataFormatException
- if byte array is invalidjava.io.UnsupportedEncodingException
- if encoding is unsupportedpublic static void serialize(KVList list, java.io.OutputStream out) throws java.io.IOException
OutputStream
.
This method will use default encoding to convert strings
to byteslist
- List to serializeout
- stream to write the list tojava.io.IOException
- if some IO problems occurpublic static void serialize(KVList list, java.io.OutputStream out, java.lang.String encoding, boolean writeLen) throws java.io.IOException
OutputStream
. To convert
strings to bytes this method will use specified encoding
.
If encoding is null than default platform encoding will be used.list
- List to serializeout
- stream to write the list toencoding
- Encoding to convert stringswriteLen
- if true - length bytes are writtenjava.io.UnsupportedEncodingException
- if encoding is unsupportedjava.io.IOException
- if some IO problems occurpublic static byte[] getBytes(KeyValueCollection list)
list
- List to serialize@Deprecated public static byte[] getBytes(KVList list, java.lang.String encoding) throws java.io.UnsupportedEncodingException
encoding
.
If encoding is null than default platform encoding will be used.list
- List to serializeencoding
- Encoding to convert stringsjava.io.UnsupportedEncodingException
- if wrong encoding is specified@Deprecated public static byte[] getBytes(KVList list, java.lang.String encoding, boolean useLen) throws java.io.UnsupportedEncodingException
encoding
.
If encoding is null than default platform encoding will be used.list
- List to serializeencoding
- Encoding to convert stringsuseLen
- if true - buffer contains length bytes for the listjava.io.UnsupportedEncodingException
- if wrong encoding is specifiedpublic static byte[] getBytes(KVList list, boolean useUtfString, java.lang.String encoding, boolean useLen) throws java.io.UnsupportedEncodingException
encoding
.
If encoding is null than default platform encoding will be used.list
- List to serializeencoding
- Encoding to convert stringsuseLen
- if true - buffer contains length bytes for the listjava.io.UnsupportedEncodingException
- if wrong encoding is specifiedpublic static byte[] getBytes(KVList list, boolean useUtfString, java.lang.String encoding) throws java.io.UnsupportedEncodingException
encoding
.
If encoding is null than default platform encoding will be used.list
- List to serializeencoding
- Encoding to convert stringsuseLen
- if true - buffer contains length bytes for the listjava.io.UnsupportedEncodingException
- if wrong encoding is specifiedSend comments on this topicTechpubs.webadmin@genesys.com.
Document version: 9.0.006.00
Copyright © 2006–2019 Genesys Telecommunications Laboratories, Inc. All rights reserved.