Package com.verisign.epp.framework
Class EPPXMLByteArrayAssembler
java.lang.Object
com.verisign.epp.framework.EPPXMLByteArrayAssembler
- All Implemented Interfaces:
EPPByteArrayAssembler
The
EPPXMLByteArrayAssembler class provides an implementation of
EPPByteArrayAssembler that can assemble/disassemble
EPPMessages and EPPEventResponses to and from
byte arrays that contain the streamed XML. - See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionConstruct and instance of anEPPXMLByteArrayAssembler -
Method Summary
Modifier and TypeMethodDescriptionTakes an inputbytearray and reads XML from it to create anEPPEventbyte[]encode(EPPEventResponse aResponse, Object aData) Takes anEPPEventResponseand serializes it to abytearray 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.
-
Constructor Details
-
EPPXMLByteArrayAssembler
public EPPXMLByteArrayAssembler()Construct and instance of anEPPXMLByteArrayAssembler
-
-
Method Details
-
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
Takes an inputbytearray and reads XML from it to create anEPPEvent- Specified by:
decodein 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
EPPEventthat is created from the InputStream - Throws:
EPPAssemblerException- Error creating theEPPEvent
-
encode
Takes anEPPEventResponseand serializes it to abytearray in XML Format.- Specified by:
encodein interfaceEPPByteArrayAssembler- Parameters:
aResponse- The response that will be serializedaData- A data object which can be used to store context information.- Returns:
bytearray containing the encoded data.- Throws:
EPPAssemblerException- Error serializing theEPPEventResponse
-