public class JNRPERequest extends Object
Constructor and Description |
---|
JNRPERequest(InputStream in)
This constructor initializes the object with the data read from the given.
|
Modifier and Type | Method and Description |
---|---|
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.
|
void |
setCRC(int iCRC)
Sets the CRC value.
|
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 |
validate()
Validates the packet CRC.
|
public JNRPERequest(InputStream in) throws IOException, BadCRCException
in
- The stream containing the data to be parsedIOException
- On any IO exceptionBadCRCException
- If the CRC can't be validatedpublic int getCRC()
public PacketType getPacketType()
public PacketVersion getPacketVersion()
public void setCRC(int iCRC)
iCRC
- The new CRC valuepublic void setPacketVersion(PacketVersion version)
version
- The packet versionpublic int getResultCode()
public void setResultCode(int status)
status
- The new result codepublic void validate() throws BadCRCException
BadCRCException
- If the CRC can't be validatedpublic byte[] toByteArray()
public String getStringMessage()
Copyright © 2013. All Rights Reserved.