public class NetworkEncryptionCipherPacket extends java.lang.Object implements IStreamedPacket, IAcknowledgement, IInternalCache
Major ID: 255 Minor ID: 250
Constructor and Description |
---|
NetworkEncryptionCipherPacket(java.lang.Boolean acknowledgement,
java.lang.String[] cipherNames)
Constructs a new instance of NetworkEncryptionCipherPacket with the specified acknowledgement value and the specified ciphers.
|
Modifier and Type | Method and Description |
---|---|
java.lang.String[] |
getCiphers()
Gets the cipher names this packet contains.
|
PacketProtocolInformation |
getProtocol()
Gets the protocol information.
|
int |
getSize()
Gets the size of the output data.
|
static PacketProtocolInformation |
getTheProtocol()
Gets the protocol information statically.
|
boolean |
isAcknowledgement()
Gets if the class instance is an Acknowledgement.
|
boolean |
isCacheUsed()
Gets if the cipher information is cached.
|
boolean |
isValid()
Gets if the packet is valid.
|
void |
loadPayload(byte[] packetData)
Loads the packet payload from save data.
|
void |
readData(java.io.OutputStream outputStream)
Reads payload data to an
OutputStream . |
byte[] |
savePayload()
Saves the packet payload to a byte array.
|
void |
setCacheUsed(boolean used)
Sets if the cipher information is cached.
|
void |
setCiphers(java.lang.String[] cipherNames)
Sets the cipher names this packet contains.
|
void |
writeData(java.io.InputStream inputStream,
int size)
Writes payload data from an
InputStream . |
public NetworkEncryptionCipherPacket(java.lang.Boolean acknowledgement, java.lang.String[] cipherNames)
acknowledgement
- The acknowledgement value to use (Can be null).cipherNames
- The cipher names.java.lang.NullPointerException
- cipherNames is null.public boolean isAcknowledgement()
isAcknowledgement
in interface IAcknowledgement
public boolean isValid()
public PacketProtocolInformation getProtocol()
getProtocol
in interface IPacket
public static PacketProtocolInformation getTheProtocol()
public byte[] savePayload() throws PacketException
savePayload
in interface IPacket
PacketException
- An Exception has occurred.public void loadPayload(byte[] packetData) throws PacketException
loadPayload
in interface IPacket
packetData
- The packet payload data.java.lang.NullPointerException
- The new store data is null.PacketException
- An Exception has occurred.public void readData(java.io.OutputStream outputStream) throws java.io.IOException, PacketException
OutputStream
.readData
in interface IStreamedPacket
outputStream
- The output stream to read data to.java.lang.NullPointerException
- outputStream is null.java.io.IOException
- An IO Exception has occurred.PacketException
- An Exception has occurred.public void writeData(java.io.InputStream inputStream, int size) throws java.io.IOException, PacketException
InputStream
.writeData
in interface IStreamedPacket
inputStream
- The input stream to write data from.size
- The size of the input payload in bytes.java.lang.NullPointerException
- inputStream is null.java.lang.IllegalArgumentException
- size is less than 0.java.io.IOException
- An IO Exception has occurred.PacketException
- An Exception has occurred.public int getSize() throws PacketException
getSize
in interface IStreamedPacket
PacketException
- An Exception has occurred.public java.lang.String[] getCiphers()
public void setCiphers(java.lang.String[] cipherNames)
cipherNames
- The array of cipher names.java.lang.NullPointerException
- cipherNames is null.public boolean isCacheUsed()
isCacheUsed
in interface IInternalCache
public void setCacheUsed(boolean used)
setCacheUsed
in interface IInternalCache
used
- If the cipher information is cached.