Package com.verisign.epp.framework
Class EPPXMLByteArrayAssembler
- java.lang.Object
-
- com.verisign.epp.framework.EPPXMLByteArrayAssembler
-
- All Implemented Interfaces:
EPPByteArrayAssembler
public class EPPXMLByteArrayAssembler extends java.lang.Object implements EPPByteArrayAssembler
TheEPPXMLByteArrayAssembler
class provides an implementation ofEPPByteArrayAssembler
that can assemble/disassembleEPPMessage
s andEPPEventResponse
s to and frombyte
arrays that contain the streamed XML.
- See Also:
EPPByteArrayAssembler
-
-
Constructor Summary
Constructors Constructor Description EPPXMLByteArrayAssembler()
Construct and instance of anEPPXMLByteArrayAssembler
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description EPPEvent
decode(byte[] aBytes, java.lang.Object aData)
Takes an inputbyte
array and reads XML from it to create anEPPEvent
byte[]
encode(EPPEventResponse aResponse, java.lang.Object aData)
Takes anEPPEventResponse
and serializes it to abyte
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.
-
-
-
Method Detail
-
toBytes
public 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.- Parameters:
aInteger
- The integer that needs to be converted to a byte array.- Returns:
- The byte array representation of the integer.
-
decode
public EPPEvent decode(byte[] aBytes, java.lang.Object aData) throws EPPAssemblerException
Takes an inputbyte
array and reads XML from it to create anEPPEvent
- Specified by:
decode
in interfaceEPPByteArrayAssembler
- Parameters:
aBytes
- The byte array to read data from.aData
- A data object which can be used to store context information.- Returns:
- EPPEvent The
EPPEvent
that is created from the InputStream - Throws:
EPPAssemblerException
- Error creating theEPPEvent
-
encode
public byte[] encode(EPPEventResponse aResponse, java.lang.Object aData) throws EPPAssemblerException
Takes anEPPEventResponse
and serializes it to abyte
array in XML Format.- Specified by:
encode
in interfaceEPPByteArrayAssembler
- Parameters:
aResponse
- The response that will be serializedaData
- A data object which can be used to store context information.- Returns:
byte
array containing the encoded data.- Throws:
EPPAssemblerException
- Error serializing theEPPEventResponse
-
-