public final class JNRPEResponse extends Object
| Constructor and Description |
|---|
JNRPEResponse()
Default constructor.
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
_setMessage(String sMessage)
Sets the packet message.
|
protected void |
fromInputStream(InputStream in)
Initialize the object reading the data from the input stream.
|
int |
getCRC()
Returns the packet CRC value.
|
PacketType |
getPacketType()
Returns the packet type.
|
PacketVersion |
getPacketVersion()
Returns the packet version.
|
int |
getResultCode()
Returns the result code.
|
String |
getStringMessage()
Returns the string message.
|
protected void |
initRandomBuffer()
Initializes the arrays with random data.
|
void |
setCRC(int iCRC)
Sets the CRC value.
|
void |
setMessage(String sMessage)
Sets the message to be included in the response.
|
protected void |
setPacketType(PacketType packetType)
Sets the packet type.
|
void |
setPacketVersion(PacketVersion version)
Sets the packet version.
|
void |
setResultCode(int status)
Sets the result code.
|
byte[] |
toByteArray()
Converts the packet object to its byte array representation.
|
void |
updateCRC()
Updates the CRC value.
|
void |
validate()
Validates the packet CRC.
|
public void updateCRC()
public void setMessage(String sMessage)
sMessage - public int getCRC()
public PacketType getPacketType()
public PacketVersion getPacketVersion()
public void setCRC(int iCRC)
iCRC - The new CRC valueprotected void setPacketType(PacketType packetType)
packetType - The new packet typepublic void setPacketVersion(PacketVersion version)
version - The packet versionpublic int getResultCode()
public void setResultCode(int status)
status - The new result codeprotected void fromInputStream(InputStream in) throws IOException
in - The stream to be readIOException - On any I/O errorpublic void validate()
throws BadCRCException
BadCRCException - If the CRC can't be validatedpublic byte[] toByteArray()
public String getStringMessage()
protected void _setMessage(String sMessage)
IJNRPEConstants#MAX_PACKETBUFFER_LENGTH than it gets truncated to
IJNRPEConstants#MAX_PACKETBUFFER_LENGTH bytes.sMessage - The messageprotected void initRandomBuffer()
Copyright © 2012. All Rights Reserved.