public class EPPXMLByteArrayAssembler extends java.lang.Object implements EPPByteArrayAssembler
EPPXMLByteArrayAssembler
class provides an implementation of
EPPByteArrayAssembler
that can assemble/disassemble
EPPMessage
s and EPPEventResponse
s to and from
byte
arrays that contain the streamed XML. EPPByteArrayAssembler
Constructor and Description |
---|
EPPXMLByteArrayAssembler()
Construct and instance of an
EPPXMLByteArrayAssembler |
Modifier and Type | Method and Description |
---|---|
EPPEvent |
decode(byte[] aBytes,
java.lang.Object aData)
Takes an input
byte array and reads XML from it to create an
EPPEvent |
byte[] |
encode(EPPEventResponse aResponse,
java.lang.Object aData)
Takes an
EPPEventResponse and serializes it to a
byte array in XML Format. |
static byte[] |
toBytes(int aInteger)
Converts an integer to a byte array of size 4 with first array element
containing the first 8 bits of the integer, the second array element
containing the 9th to 16th bits of the integer, the third array element
containing the 17th to 24th bits of the integer and the last array
element containing the last 8 bits of the integer.
|
public EPPXMLByteArrayAssembler()
EPPXMLByteArrayAssembler
public static byte[] toBytes(int aInteger)
aInteger
- The integer that needs to be converted to a byte array.public EPPEvent decode(byte[] aBytes, java.lang.Object aData) throws EPPAssemblerException
byte
array and reads XML from it to create an
EPPEvent
decode
in interface EPPByteArrayAssembler
aBytes
- The byte array to read data from.aData
- A data object which can be used to store context information. EPPEvent
that is created from the
InputStreamEPPAssemblerException
- Error creating the EPPEvent
public byte[] encode(EPPEventResponse aResponse, java.lang.Object aData) throws EPPAssemblerException
EPPEventResponse
and serializes it to a
byte
array in XML Format.encode
in interface EPPByteArrayAssembler
aResponse
- The response that will be serializedaData
- A data object which can be used to store context information.byte
array containing the encoded data.EPPAssemblerException
- Error serializing the EPPEventResponse