public class ElementParser extends Object implements IElementParser
| Constructor and Description |
|---|
ElementParser() |
| Modifier and Type | Method and Description |
|---|---|
byte[] |
addressToBytes(InetAddress address)
Convert InetAddress to byte array representation
|
InetAddress |
bytesToAddress(byte[] rawData)
Convert byte array to InetAddress
|
Date |
bytesToDate(byte[] rawData)
Convert byte array to date
|
double |
bytesToDouble(byte[] rawData)
Convert byte array to double
|
float |
bytesToFloat(byte[] rawData)
Convert byte array to float
|
int |
bytesToInt(byte[] rawData)
Convert byte array to int
|
long |
bytesToLong(byte[] rawData)
Convert byte array to long
|
<T> T |
bytesToObject(Class<?> iface,
byte[] rawdata)
Convert byte array to specefied object
|
String |
bytesToOctetString(byte[] rawData)
Convert byte array to octet string
|
String |
bytesToUtf8String(byte[] rawData)
Convert byte array to utf8 string
|
byte[] |
dateToBytes(Date date)
Convert Date to byte array representation
|
org.jdiameter.client.impl.parser.AvpSetImpl |
decodeAvpSet(byte[] buffer) |
org.jdiameter.client.impl.parser.AvpSetImpl |
decodeAvpSet(byte[] buffer,
int shift) |
byte[] |
encodeAvp(org.jdiameter.client.impl.parser.AvpImpl avp) |
byte[] |
encodeAvpSet(AvpSet avps) |
byte[] |
float32ToBytes(float value)
Convert float to byte array representation
|
byte[] |
float64ToBytes(double value)
Convert double to byte array representation
|
byte[] |
int32ToBytes(int value)
Convert int to byte array representation
|
byte[] |
int64ToBytes(long value)
Convert long to byte array representation
|
byte[] |
intU32ToBytes(long value)
Convert long to 4-byte array representation
|
byte[] |
objectToBytes(Object data)
Convert specified object to byte array representation
|
byte[] |
octetStringToBytes(String value)
Convert octet string to byte array representation
|
protected ByteBuffer |
prepareBuffer(byte[] bytes,
int len) |
byte[] |
utf8StringToBytes(String value)
Convert utf8 string to byte array representation
|
public int bytesToInt(byte[] rawData)
throws AvpDataException
IElementParserbytesToInt in interface IElementParserrawData - byte representation of int valueAvpDataExceptionpublic long bytesToLong(byte[] rawData)
throws AvpDataException
IElementParserbytesToLong in interface IElementParserrawData - byte representation of long valueAvpDataExceptionpublic float bytesToFloat(byte[] rawData)
throws AvpDataException
IElementParserbytesToFloat in interface IElementParserrawData - byte representation of float valueAvpDataExceptionpublic double bytesToDouble(byte[] rawData)
throws AvpDataException
IElementParserbytesToDouble in interface IElementParserrawData - byte representation of double valueAvpDataExceptionprotected ByteBuffer prepareBuffer(byte[] bytes, int len) throws AvpDataException
AvpDataExceptionpublic String bytesToOctetString(byte[] rawData) throws AvpDataException
IElementParserbytesToOctetString in interface IElementParserrawData - byte representation of octet string valueAvpDataExceptionpublic String bytesToUtf8String(byte[] rawData) throws AvpDataException
IElementParserbytesToUtf8String in interface IElementParserrawData - byte representation of utf8 string valueAvpDataExceptionpublic Date bytesToDate(byte[] rawData) throws AvpDataException
IElementParserbytesToDate in interface IElementParserrawData - byte representation of date valueAvpDataExceptionpublic InetAddress bytesToAddress(byte[] rawData) throws AvpDataException
IElementParserbytesToAddress in interface IElementParserrawData - byte representation of InetAddress valueAvpDataExceptionpublic byte[] int32ToBytes(int value)
IElementParserint32ToBytes in interface IElementParservalue - int valuepublic byte[] intU32ToBytes(long value)
IElementParserintU32ToBytes in interface IElementParservalue - long valuepublic byte[] int64ToBytes(long value)
IElementParserint64ToBytes in interface IElementParservalue - long valuepublic byte[] float32ToBytes(float value)
IElementParserfloat32ToBytes in interface IElementParservalue - float valuepublic byte[] float64ToBytes(double value)
IElementParserfloat64ToBytes in interface IElementParservalue - double valuepublic byte[] octetStringToBytes(String value) throws ParseException
IElementParseroctetStringToBytes in interface IElementParservalue - octet string valueParseExceptionpublic byte[] utf8StringToBytes(String value) throws ParseException
IElementParserutf8StringToBytes in interface IElementParservalue - utf8 string valueParseExceptionpublic byte[] addressToBytes(InetAddress address)
IElementParseraddressToBytes in interface IElementParseraddress - InetAddress valuepublic byte[] dateToBytes(Date date)
IElementParserdateToBytes in interface IElementParserdate - Date valuepublic <T> T bytesToObject(Class<?> iface, byte[] rawdata) throws AvpDataException
IElementParserbytesToObject in interface IElementParseriface - type of objectrawdata - byte representation of InetAddress valueAvpDataExceptionpublic byte[] objectToBytes(Object data) throws ParseException
IElementParserobjectToBytes in interface IElementParserdata - objectParseExceptionpublic org.jdiameter.client.impl.parser.AvpSetImpl decodeAvpSet(byte[] buffer)
throws IOException,
AvpDataException
IOExceptionAvpDataExceptionpublic org.jdiameter.client.impl.parser.AvpSetImpl decodeAvpSet(byte[] buffer,
int shift)
throws IOException,
AvpDataException
buffer - shift - - shift in buffer, for instance for whole message it will have non zero valueIOExceptionAvpDataExceptionpublic byte[] encodeAvpSet(AvpSet avps)
public byte[] encodeAvp(org.jdiameter.client.impl.parser.AvpImpl avp)
Copyright © 2016. All Rights Reserved.