diff --git a/JavaDoc/allclasses-frame.html b/JavaDoc/allclasses-frame.html index a4f6f91..615a04f 100644 --- a/JavaDoc/allclasses-frame.html +++ b/JavaDoc/allclasses-frame.html @@ -2,9 +2,9 @@
- +DigestProvider
.PacketLoader(com.captainalm.lib.stdcrypt.digest.DigestProvider provider,
+ boolean oldPacketFormat)
+DigestProvider
+ and if the old packet format should be used.static int
addMostSignificantFlag(int value)
+boolean
areInvalidPacketsAllowed()
static byte[]
getByteArrayFromInteger(int i)
com.captainalm.lib.stdcrypt.digest.DigestProvider
getHashProvider()
DigestProvider
to use for the payload of the packets on the trailer.static int
getIntegerFromByteArray(byte[] bytes)
int
getPacketSize(IPacket packet,
boolean includeInformation,
@@ -191,26 +204,38 @@ extends java.lang.Object
Gets the total size of a written packet in bytes.
boolean
isOldPacketFormatInUse()
+static byte[]
readArrayFromInputStream(java.io.InputStream inputStream,
int length)
InputStream
.static byte
readByteFromInputStream(java.io.InputStream inputStream)
InputStream
.static int
readByteIntegerFromInputStream(java.io.InputStream inputStream)
+InputStream
.static int
readInteger(java.io.InputStream inputStream)
InputStream
.IPacket
readPacket(java.io.InputStream inputStream,
IPacketFactory factory,
@@ -218,7 +243,7 @@ extends java.lang.Object
Reads a IPacket
from an input stream.
IPacket
readPacketNoDigest(byte[] arrayIn,
IPacketFactory factory,
@@ -226,7 +251,7 @@ extends java.lang.Object
Reads a IPacket
from a byte array (No digest support).
IPacket
readPacketNoDigest(java.io.InputStream inputStream,
IPacketFactory factory,
@@ -234,7 +259,7 @@ extends java.lang.Object
Reads a IPacket
from an input stream (No digest support).
IPacket
readStreamedPacket(java.io.InputStream inputStream,
IPacketFactory factory,
@@ -242,7 +267,7 @@ extends java.lang.Object
Reads a IStreamedPacket
from an input stream.
IPacket
readStreamedPacketNoDigest(java.io.InputStream inputStream,
IPacketFactory factory,
@@ -250,20 +275,32 @@ extends java.lang.Object
Reads a IStreamedPacket
from an input stream (No digest support).
void
setAllowInvalidPackets(boolean allowInvalidPackets)
void
setOldPacketFormatUsage(boolean useOldFormat)
+static int
subtractMostSignificantFlag(int value)
+static void
writeInteger(java.io.OutputStream outputStream,
int i)
OutputStream
using 4 bytes.void
writePacket(java.io.OutputStream outputStream,
IPacket packet,
@@ -271,14 +308,14 @@ extends java.lang.Object
Writes a IPacket
to an output stream (No digest support).
byte[]
writePacketNoDigest(IPacket packet,
boolean writeInformation)
IPacket
to a byte array (No digest support).void
writePacketNoDigest(java.io.OutputStream outputStream,
IPacket packet,
@@ -322,13 +359,13 @@ extends java.lang.Object
-
+
-
PacketLoader
public PacketLoader(com.captainalm.lib.stdcrypt.digest.DigestProvider provider)
Constructs a new Packet loader instance with the specified DigestProvider
.
If using a digest provider, make sure all endpoints use the same algorithm;
- if null, no trailer is created or expected;
+ if null, no trailer is created;
this is ignored if saving / loading packets from byte arrays.
- Parameters:
@@ -336,6 +373,26 @@ extends java.lang.Object
+
+
+
+
+-
+
PacketLoader
+public PacketLoader(com.captainalm.lib.stdcrypt.digest.DigestProvider provider,
+ boolean oldPacketFormat)
+Constructs a new Packet loader instance with the specified DigestProvider
+ and if the old packet format should be used.
+ If using a digest provider, make sure all endpoints use the same algorithm;
+ if null, no trailer is created;
+ this is ignored if saving / loading packets from byte arrays.
+
+- Parameters:
+provider
- The digest provider or null.
+oldPacketFormat
- If the old packet format should be used (No explicit hash indication nor length).
+
+
+
@@ -386,6 +443,66 @@ extends java.lang.Object
+
+
+
+
+-
+
isOldPacketFormatInUse
+public boolean isOldPacketFormatInUse()
+Is the old packet format in use (No explicit hash indication nor length).
+
+- Returns:
+- If the old packet format is in use.
+
+
+
+
+
+
+
+-
+
setOldPacketFormatUsage
+public void setOldPacketFormatUsage(boolean useOldFormat)
+Sets if the old packet format should be used (No explicit hash indication nor length).
+
+- Parameters:
+useOldFormat
- If the old packet format should be used.
+
+
+
+
+
+
+
+-
+
addMostSignificantFlag
+public static int addMostSignificantFlag(int value)
+Adds the most significant flag to the given integer.
+
+- Parameters:
+value
- The integer to add the flag to.
+- Returns:
+- The integer with the flag added.
+
+
+
+
+
+
+
+-
+
subtractMostSignificantFlag
+public static int subtractMostSignificantFlag(int value)
+Subtracts the most significant flag from the given integer.
+
+- Parameters:
+value
- The integer to subtract the flag from.
+- Returns:
+- The integer with the flag subtracted.
+
+
+
@@ -539,6 +656,8 @@ extends java.lang.Object
Parameters:
packet
- The packet to save.
writeInformation
- Write the PacketProtocolInformation
to the beginning of the array.
+Returns:
+The written packet data as a byte array.
Throws:
java.lang.NullPointerException
- A parameter is null.
PacketException
- An Exception has occurred.
@@ -630,7 +749,6 @@ extends java.lang.Object
i
- The integer to store.
Throws:
java.lang.NullPointerException
- outputStream is null.
-java.lang.IllegalArgumentException
- i is less than 0.
java.io.IOException
- An I/O error has occurred.
@@ -643,7 +761,8 @@ extends java.lang.Object
readByteFromInputStream
public static byte readByteFromInputStream(java.io.InputStream inputStream)
throws java.io.IOException
-Reads a byte from an InputStream
.
+Reads a byte from an InputStream
.
+ See also: readByteIntegerFromInputStream(InputStream)
.
- Parameters:
inputStream
- The input stream to read from.
@@ -655,6 +774,27 @@ extends java.lang.Object
+
+
+
+
+-
+
readByteIntegerFromInputStream
+public static int readByteIntegerFromInputStream(java.io.InputStream inputStream)
+ throws java.io.IOException
+Reads a byte (In int form) from an InputStream
.
+ See also: readByteFromInputStream(InputStream)
.
+
+- Parameters:
+inputStream
- The input stream to read from.
+- Returns:
+- The byte read (As an int).
+- Throws:
+java.lang.NullPointerException
- inputStream is null.
+java.io.IOException
- An I/O error has occurred or end of stream has been reached.
+
+
+
@@ -691,8 +831,6 @@ extends java.lang.Object
i
- The integer to save.
Returns:
The byte array.
-Throws:
-java.lang.IllegalArgumentException
- i is less than 0.
diff --git a/JavaDoc/com/captainalm/lib/calmnet/packet/PacketProtocolInformation.html b/JavaDoc/com/captainalm/lib/calmnet/packet/PacketProtocolInformation.html
index 80829a4..dbe4d4a 100644
--- a/JavaDoc/com/captainalm/lib/calmnet/packet/PacketProtocolInformation.html
+++ b/JavaDoc/com/captainalm/lib/calmnet/packet/PacketProtocolInformation.html
@@ -2,9 +2,9 @@
-
+
PacketProtocolInformation
-
+
diff --git a/JavaDoc/com/captainalm/lib/calmnet/packet/core/Base64Packet.html b/JavaDoc/com/captainalm/lib/calmnet/packet/core/Base64Packet.html
index cab4488..f8b873c 100644
--- a/JavaDoc/com/captainalm/lib/calmnet/packet/core/Base64Packet.html
+++ b/JavaDoc/com/captainalm/lib/calmnet/packet/core/Base64Packet.html
@@ -2,9 +2,9 @@
-
+
Base64Packet
-
+
diff --git a/JavaDoc/com/captainalm/lib/calmnet/packet/core/EncryptedPacket.html b/JavaDoc/com/captainalm/lib/calmnet/packet/core/EncryptedPacket.html
index de3eeac..53dffbf 100644
--- a/JavaDoc/com/captainalm/lib/calmnet/packet/core/EncryptedPacket.html
+++ b/JavaDoc/com/captainalm/lib/calmnet/packet/core/EncryptedPacket.html
@@ -2,9 +2,9 @@
-
+
EncryptedPacket
-
+
@@ -394,6 +394,7 @@ implements Throws:
java.lang.NullPointerException
- factory, loader or cipherFactory is null.
@@ -417,6 +418,7 @@ implements Throws:
java.lang.NullPointerException
- factory, loader or cipherFactory is null.
diff --git a/JavaDoc/com/captainalm/lib/calmnet/packet/core/NetworkEncryptionCipherPacket.html b/JavaDoc/com/captainalm/lib/calmnet/packet/core/NetworkEncryptionCipherPacket.html
index f168831..75f3ad1 100644
--- a/JavaDoc/com/captainalm/lib/calmnet/packet/core/NetworkEncryptionCipherPacket.html
+++ b/JavaDoc/com/captainalm/lib/calmnet/packet/core/NetworkEncryptionCipherPacket.html
@@ -2,9 +2,9 @@
-
+
NetworkEncryptionCipherPacket
-
+
diff --git a/JavaDoc/com/captainalm/lib/calmnet/packet/core/NetworkEncryptionUpgradePacket.html b/JavaDoc/com/captainalm/lib/calmnet/packet/core/NetworkEncryptionUpgradePacket.html
index ac91285..55f4337 100644
--- a/JavaDoc/com/captainalm/lib/calmnet/packet/core/NetworkEncryptionUpgradePacket.html
+++ b/JavaDoc/com/captainalm/lib/calmnet/packet/core/NetworkEncryptionUpgradePacket.html
@@ -2,9 +2,9 @@
-
+
NetworkEncryptionUpgradePacket
-
+
diff --git a/JavaDoc/com/captainalm/lib/calmnet/packet/core/NetworkIdentifierPacket.html b/JavaDoc/com/captainalm/lib/calmnet/packet/core/NetworkIdentifierPacket.html
index 298cb54..35ed013 100644
--- a/JavaDoc/com/captainalm/lib/calmnet/packet/core/NetworkIdentifierPacket.html
+++ b/JavaDoc/com/captainalm/lib/calmnet/packet/core/NetworkIdentifierPacket.html
@@ -2,9 +2,9 @@
-
+
NetworkIdentifierPacket
-
+
diff --git a/JavaDoc/com/captainalm/lib/calmnet/packet/core/NetworkSSLUpgradePacket.html b/JavaDoc/com/captainalm/lib/calmnet/packet/core/NetworkSSLUpgradePacket.html
index b43eaba..376869e 100644
--- a/JavaDoc/com/captainalm/lib/calmnet/packet/core/NetworkSSLUpgradePacket.html
+++ b/JavaDoc/com/captainalm/lib/calmnet/packet/core/NetworkSSLUpgradePacket.html
@@ -2,9 +2,9 @@
-
+
NetworkSSLUpgradePacket
-
+
diff --git a/JavaDoc/com/captainalm/lib/calmnet/packet/core/package-frame.html b/JavaDoc/com/captainalm/lib/calmnet/packet/core/package-frame.html
index 541b158..741a787 100644
--- a/JavaDoc/com/captainalm/lib/calmnet/packet/core/package-frame.html
+++ b/JavaDoc/com/captainalm/lib/calmnet/packet/core/package-frame.html
@@ -2,9 +2,9 @@
-
+
com.captainalm.lib.calmnet.packet.core
-
+
diff --git a/JavaDoc/com/captainalm/lib/calmnet/packet/core/package-summary.html b/JavaDoc/com/captainalm/lib/calmnet/packet/core/package-summary.html
index 8895e1f..eccafc7 100644
--- a/JavaDoc/com/captainalm/lib/calmnet/packet/core/package-summary.html
+++ b/JavaDoc/com/captainalm/lib/calmnet/packet/core/package-summary.html
@@ -2,9 +2,9 @@
-
+
com.captainalm.lib.calmnet.packet.core
-
+
diff --git a/JavaDoc/com/captainalm/lib/calmnet/packet/core/package-tree.html b/JavaDoc/com/captainalm/lib/calmnet/packet/core/package-tree.html
index 603bced..73c62bd 100644
--- a/JavaDoc/com/captainalm/lib/calmnet/packet/core/package-tree.html
+++ b/JavaDoc/com/captainalm/lib/calmnet/packet/core/package-tree.html
@@ -2,9 +2,9 @@
-
+
com.captainalm.lib.calmnet.packet.core Class Hierarchy
-
+
diff --git a/JavaDoc/com/captainalm/lib/calmnet/packet/factory/CALMNETPacketFactory.html b/JavaDoc/com/captainalm/lib/calmnet/packet/factory/CALMNETPacketFactory.html
index 501b32f..05fafbc 100644
--- a/JavaDoc/com/captainalm/lib/calmnet/packet/factory/CALMNETPacketFactory.html
+++ b/JavaDoc/com/captainalm/lib/calmnet/packet/factory/CALMNETPacketFactory.html
@@ -2,9 +2,9 @@
-
+
CALMNETPacketFactory
-
+
diff --git a/JavaDoc/com/captainalm/lib/calmnet/packet/factory/CALMNETPacketFactoryWithPacket.html b/JavaDoc/com/captainalm/lib/calmnet/packet/factory/CALMNETPacketFactoryWithPacket.html
index 71b44d7..c672a4c 100644
--- a/JavaDoc/com/captainalm/lib/calmnet/packet/factory/CALMNETPacketFactoryWithPacket.html
+++ b/JavaDoc/com/captainalm/lib/calmnet/packet/factory/CALMNETPacketFactoryWithPacket.html
@@ -2,9 +2,9 @@
-
+
CALMNETPacketFactoryWithPacket
-
+
diff --git a/JavaDoc/com/captainalm/lib/calmnet/packet/factory/IPacketFactory.html b/JavaDoc/com/captainalm/lib/calmnet/packet/factory/IPacketFactory.html
index 92f7866..e054863 100644
--- a/JavaDoc/com/captainalm/lib/calmnet/packet/factory/IPacketFactory.html
+++ b/JavaDoc/com/captainalm/lib/calmnet/packet/factory/IPacketFactory.html
@@ -2,9 +2,9 @@
-
+
IPacketFactory
-
+
diff --git a/JavaDoc/com/captainalm/lib/calmnet/packet/factory/package-frame.html b/JavaDoc/com/captainalm/lib/calmnet/packet/factory/package-frame.html
index c2edc72..c93b1e0 100644
--- a/JavaDoc/com/captainalm/lib/calmnet/packet/factory/package-frame.html
+++ b/JavaDoc/com/captainalm/lib/calmnet/packet/factory/package-frame.html
@@ -2,9 +2,9 @@
-
+
com.captainalm.lib.calmnet.packet.factory
-
+
diff --git a/JavaDoc/com/captainalm/lib/calmnet/packet/factory/package-summary.html b/JavaDoc/com/captainalm/lib/calmnet/packet/factory/package-summary.html
index 318b03f..d96333b 100644
--- a/JavaDoc/com/captainalm/lib/calmnet/packet/factory/package-summary.html
+++ b/JavaDoc/com/captainalm/lib/calmnet/packet/factory/package-summary.html
@@ -2,9 +2,9 @@
-
+
com.captainalm.lib.calmnet.packet.factory
-
+
diff --git a/JavaDoc/com/captainalm/lib/calmnet/packet/factory/package-tree.html b/JavaDoc/com/captainalm/lib/calmnet/packet/factory/package-tree.html
index 19ff4f7..830d572 100644
--- a/JavaDoc/com/captainalm/lib/calmnet/packet/factory/package-tree.html
+++ b/JavaDoc/com/captainalm/lib/calmnet/packet/factory/package-tree.html
@@ -2,9 +2,9 @@
-
+
com.captainalm.lib.calmnet.packet.factory Class Hierarchy
-
+
diff --git a/JavaDoc/com/captainalm/lib/calmnet/packet/fragment/FragmentAllocatePacket.html b/JavaDoc/com/captainalm/lib/calmnet/packet/fragment/FragmentAllocatePacket.html
index 0865e33..627d330 100644
--- a/JavaDoc/com/captainalm/lib/calmnet/packet/fragment/FragmentAllocatePacket.html
+++ b/JavaDoc/com/captainalm/lib/calmnet/packet/fragment/FragmentAllocatePacket.html
@@ -2,9 +2,9 @@
-
+
FragmentAllocatePacket
-
+
diff --git a/JavaDoc/com/captainalm/lib/calmnet/packet/fragment/FragmentAllocationPacket.html b/JavaDoc/com/captainalm/lib/calmnet/packet/fragment/FragmentAllocationPacket.html
index afb51ff..068e83b 100644
--- a/JavaDoc/com/captainalm/lib/calmnet/packet/fragment/FragmentAllocationPacket.html
+++ b/JavaDoc/com/captainalm/lib/calmnet/packet/fragment/FragmentAllocationPacket.html
@@ -2,9 +2,9 @@
-
+
FragmentAllocationPacket
-
+
diff --git a/JavaDoc/com/captainalm/lib/calmnet/packet/fragment/FragmentMessagePacket.html b/JavaDoc/com/captainalm/lib/calmnet/packet/fragment/FragmentMessagePacket.html
index 0aeccdb..de836b0 100644
--- a/JavaDoc/com/captainalm/lib/calmnet/packet/fragment/FragmentMessagePacket.html
+++ b/JavaDoc/com/captainalm/lib/calmnet/packet/fragment/FragmentMessagePacket.html
@@ -2,9 +2,9 @@
-
+
FragmentMessagePacket
-
+
diff --git a/JavaDoc/com/captainalm/lib/calmnet/packet/fragment/FragmentMessageResponsePacket.html b/JavaDoc/com/captainalm/lib/calmnet/packet/fragment/FragmentMessageResponsePacket.html
index 4419b6b..82ad3ec 100644
--- a/JavaDoc/com/captainalm/lib/calmnet/packet/fragment/FragmentMessageResponsePacket.html
+++ b/JavaDoc/com/captainalm/lib/calmnet/packet/fragment/FragmentMessageResponsePacket.html
@@ -2,9 +2,9 @@
-
+
FragmentMessageResponsePacket
-
+
diff --git a/JavaDoc/com/captainalm/lib/calmnet/packet/fragment/FragmentPIDAKNPacket.html b/JavaDoc/com/captainalm/lib/calmnet/packet/fragment/FragmentPIDAKNPacket.html
index 9da55a3..b7f0263 100644
--- a/JavaDoc/com/captainalm/lib/calmnet/packet/fragment/FragmentPIDAKNPacket.html
+++ b/JavaDoc/com/captainalm/lib/calmnet/packet/fragment/FragmentPIDAKNPacket.html
@@ -2,9 +2,9 @@
-
+
FragmentPIDAKNPacket
-
+
diff --git a/JavaDoc/com/captainalm/lib/calmnet/packet/fragment/FragmentPIDMSGPacket.html b/JavaDoc/com/captainalm/lib/calmnet/packet/fragment/FragmentPIDMSGPacket.html
index e9a2815..e5b5ec8 100644
--- a/JavaDoc/com/captainalm/lib/calmnet/packet/fragment/FragmentPIDMSGPacket.html
+++ b/JavaDoc/com/captainalm/lib/calmnet/packet/fragment/FragmentPIDMSGPacket.html
@@ -2,9 +2,9 @@
-
+
FragmentPIDMSGPacket
-
+
diff --git a/JavaDoc/com/captainalm/lib/calmnet/packet/fragment/FragmentPIDPacket.html b/JavaDoc/com/captainalm/lib/calmnet/packet/fragment/FragmentPIDPacket.html
index 6010302..184c115 100644
--- a/JavaDoc/com/captainalm/lib/calmnet/packet/fragment/FragmentPIDPacket.html
+++ b/JavaDoc/com/captainalm/lib/calmnet/packet/fragment/FragmentPIDPacket.html
@@ -2,9 +2,9 @@
-
+
FragmentPIDPacket
-
+
diff --git a/JavaDoc/com/captainalm/lib/calmnet/packet/fragment/FragmentReceiver.html b/JavaDoc/com/captainalm/lib/calmnet/packet/fragment/FragmentReceiver.html
index 7311898..da37c1f 100644
--- a/JavaDoc/com/captainalm/lib/calmnet/packet/fragment/FragmentReceiver.html
+++ b/JavaDoc/com/captainalm/lib/calmnet/packet/fragment/FragmentReceiver.html
@@ -2,9 +2,9 @@
-
+
FragmentReceiver
-
+
@@ -266,25 +266,25 @@ extends java.lang.Object
void
setResponseVerification(boolean state)
-Sets whether responses should be verified.
+Sets whether responses should be verified by sending back the payload to be verified.
void
setSentDataWillBeAllVerified(boolean state)
-Gets whether all sent fragments are verified to be equal.
+Gets whether all sent fragments are expected to be verified.
boolean
shouldSentDataBeAllVerified()
-Gets whether all sent fragments are verified to be equal.
+Gets whether all sent fragments are expected to be verified.
boolean
shouldVerifyResponses()
-Gets whether responses should be verified.
+Gets whether responses should be verified by sending back the payload to be verified.
@@ -587,10 +587,10 @@ extends java.lang.Object
shouldVerifyResponses
public boolean shouldVerifyResponses()
-Gets whether responses should be verified.
+Gets whether responses should be verified by sending back the payload to be verified.
- Returns:
-- Should responses be verified.
+- Should responses be verified by sending back the payload.
@@ -601,11 +601,11 @@ extends java.lang.Object
setResponseVerification
public void setResponseVerification(boolean state)
-Sets whether responses should be verified.
+Sets whether responses should be verified by sending back the payload to be verified.
If set to false, setSentDataWillBeAllVerified(boolean)
will be set to false too.
- Parameters:
-state
- If responses should be verified.
+state
- If responses should be verified by sending back the payload.
@@ -616,10 +616,10 @@ extends java.lang.Object
shouldSentDataBeAllVerified
public boolean shouldSentDataBeAllVerified()
-Gets whether all sent fragments are verified to be equal.
+Gets whether all sent fragments are expected to be verified.
- Returns:
-- If all sent fragments will be verified to be equal.
+- If all sent fragments are expected to be verified.
@@ -630,11 +630,11 @@ extends java.lang.Object
setSentDataWillBeAllVerified
public void setSentDataWillBeAllVerified(boolean state)
-Gets whether all sent fragments are verified to be equal.
+Gets whether all sent fragments are expected to be verified.
Requires setResponseVerification(boolean)
set to true.
- Parameters:
-state
- If all sent fragments will be verified to be equal.
+state
- If all sent fragments are expected to be verified.
diff --git a/JavaDoc/com/captainalm/lib/calmnet/packet/fragment/FragmentRetrySendPacket.html b/JavaDoc/com/captainalm/lib/calmnet/packet/fragment/FragmentRetrySendPacket.html
index b430803..a143f69 100644
--- a/JavaDoc/com/captainalm/lib/calmnet/packet/fragment/FragmentRetrySendPacket.html
+++ b/JavaDoc/com/captainalm/lib/calmnet/packet/fragment/FragmentRetrySendPacket.html
@@ -2,9 +2,9 @@
-
+
FragmentRetrySendPacket
-
+
diff --git a/JavaDoc/com/captainalm/lib/calmnet/packet/fragment/FragmentSendCompletePacket.html b/JavaDoc/com/captainalm/lib/calmnet/packet/fragment/FragmentSendCompletePacket.html
index 6df3e50..d866822 100644
--- a/JavaDoc/com/captainalm/lib/calmnet/packet/fragment/FragmentSendCompletePacket.html
+++ b/JavaDoc/com/captainalm/lib/calmnet/packet/fragment/FragmentSendCompletePacket.html
@@ -2,9 +2,9 @@
-
+
FragmentSendCompletePacket
-
+
diff --git a/JavaDoc/com/captainalm/lib/calmnet/packet/fragment/FragmentSendStopPacket.html b/JavaDoc/com/captainalm/lib/calmnet/packet/fragment/FragmentSendStopPacket.html
index d019095..d830e9d 100644
--- a/JavaDoc/com/captainalm/lib/calmnet/packet/fragment/FragmentSendStopPacket.html
+++ b/JavaDoc/com/captainalm/lib/calmnet/packet/fragment/FragmentSendStopPacket.html
@@ -2,9 +2,9 @@
-
+
FragmentSendStopPacket
-
+
diff --git a/JavaDoc/com/captainalm/lib/calmnet/packet/fragment/FragmentSendVerifyCompletePacket.html b/JavaDoc/com/captainalm/lib/calmnet/packet/fragment/FragmentSendVerifyCompletePacket.html
index 242b09e..04047d8 100644
--- a/JavaDoc/com/captainalm/lib/calmnet/packet/fragment/FragmentSendVerifyCompletePacket.html
+++ b/JavaDoc/com/captainalm/lib/calmnet/packet/fragment/FragmentSendVerifyCompletePacket.html
@@ -2,9 +2,9 @@
-
+
FragmentSendVerifyCompletePacket
-
+
diff --git a/JavaDoc/com/captainalm/lib/calmnet/packet/fragment/FragmentSender.html b/JavaDoc/com/captainalm/lib/calmnet/packet/fragment/FragmentSender.html
index 6093d59..9b0470d 100644
--- a/JavaDoc/com/captainalm/lib/calmnet/packet/fragment/FragmentSender.html
+++ b/JavaDoc/com/captainalm/lib/calmnet/packet/fragment/FragmentSender.html
@@ -2,9 +2,9 @@
-
+
FragmentSender
-
+
@@ -246,13 +246,13 @@ extends java.lang.Object
void
setResponseVerification(boolean state)
-Sets whether responses should be verified.
+Sets whether responses should be verified by checking if they are equal.
void
setSentDataWillBeAllVerified(boolean state)
-Gets whether all sent fragments are verified to be equal.
+Gets whether all sent fragments are verified via resend checks for equality.
@@ -264,13 +264,13 @@ extends java.lang.Object
boolean
shouldSentDataBeAllVerified()
-Gets whether all sent fragments are verified to be equal.
+Gets whether all sent fragments are verified via resend checks for equality.
boolean
shouldVerifyResponses()
-Gets whether responses should be verified.
+Gets whether responses should be verified by checking if they are equal.
@@ -573,7 +573,7 @@ extends java.lang.Object
shouldVerifyResponses
public boolean shouldVerifyResponses()
-Gets whether responses should be verified.
+Gets whether responses should be verified by checking if they are equal.
- Returns:
- Should responses be verified.
@@ -587,7 +587,7 @@ extends java.lang.Object
setResponseVerification
public void setResponseVerification(boolean state)
-Sets whether responses should be verified.
+Sets whether responses should be verified by checking if they are equal.
If set to false, setSentDataWillBeAllVerified(boolean)
will be set to false too.
- Parameters:
@@ -602,10 +602,10 @@ extends java.lang.Object
shouldSentDataBeAllVerified
public boolean shouldSentDataBeAllVerified()
-Gets whether all sent fragments are verified to be equal.
+Gets whether all sent fragments are verified via resend checks for equality.
- Returns:
-- If all sent fragments will be verified to be equal.
+- If all sent fragments will be verified via resend checks for equality.
@@ -616,11 +616,11 @@ extends java.lang.Object
setSentDataWillBeAllVerified
public void setSentDataWillBeAllVerified(boolean state)
-Gets whether all sent fragments are verified to be equal.
+Gets whether all sent fragments are verified via resend checks for equality.
Requires setResponseVerification(boolean)
set to true.
- Parameters:
-state
- If all sent fragments will be verified to be equal.
+state
- If all sent fragments will be verified via resend checks for equality.
diff --git a/JavaDoc/com/captainalm/lib/calmnet/packet/fragment/package-frame.html b/JavaDoc/com/captainalm/lib/calmnet/packet/fragment/package-frame.html
index fc16473..e3f2ff6 100644
--- a/JavaDoc/com/captainalm/lib/calmnet/packet/fragment/package-frame.html
+++ b/JavaDoc/com/captainalm/lib/calmnet/packet/fragment/package-frame.html
@@ -2,9 +2,9 @@
-
+
com.captainalm.lib.calmnet.packet.fragment
-
+
diff --git a/JavaDoc/com/captainalm/lib/calmnet/packet/fragment/package-summary.html b/JavaDoc/com/captainalm/lib/calmnet/packet/fragment/package-summary.html
index c7a5fb1..af50355 100644
--- a/JavaDoc/com/captainalm/lib/calmnet/packet/fragment/package-summary.html
+++ b/JavaDoc/com/captainalm/lib/calmnet/packet/fragment/package-summary.html
@@ -2,9 +2,9 @@
-
+
com.captainalm.lib.calmnet.packet.fragment
-
+
diff --git a/JavaDoc/com/captainalm/lib/calmnet/packet/fragment/package-tree.html b/JavaDoc/com/captainalm/lib/calmnet/packet/fragment/package-tree.html
index d6d62f4..b262ea7 100644
--- a/JavaDoc/com/captainalm/lib/calmnet/packet/fragment/package-tree.html
+++ b/JavaDoc/com/captainalm/lib/calmnet/packet/fragment/package-tree.html
@@ -2,9 +2,9 @@
-
+
com.captainalm.lib.calmnet.packet.fragment Class Hierarchy
-
+
diff --git a/JavaDoc/com/captainalm/lib/calmnet/packet/package-frame.html b/JavaDoc/com/captainalm/lib/calmnet/packet/package-frame.html
index 6c91931..4f7cc2b 100644
--- a/JavaDoc/com/captainalm/lib/calmnet/packet/package-frame.html
+++ b/JavaDoc/com/captainalm/lib/calmnet/packet/package-frame.html
@@ -2,9 +2,9 @@
-
+
com.captainalm.lib.calmnet.packet
-
+
diff --git a/JavaDoc/com/captainalm/lib/calmnet/packet/package-summary.html b/JavaDoc/com/captainalm/lib/calmnet/packet/package-summary.html
index 7a5ad24..50b404f 100644
--- a/JavaDoc/com/captainalm/lib/calmnet/packet/package-summary.html
+++ b/JavaDoc/com/captainalm/lib/calmnet/packet/package-summary.html
@@ -2,9 +2,9 @@
-
+
com.captainalm.lib.calmnet.packet
-
+
diff --git a/JavaDoc/com/captainalm/lib/calmnet/packet/package-tree.html b/JavaDoc/com/captainalm/lib/calmnet/packet/package-tree.html
index efaa8d8..75626e5 100644
--- a/JavaDoc/com/captainalm/lib/calmnet/packet/package-tree.html
+++ b/JavaDoc/com/captainalm/lib/calmnet/packet/package-tree.html
@@ -2,9 +2,9 @@
-
+
com.captainalm.lib.calmnet.packet Class Hierarchy
-
+
diff --git a/JavaDoc/com/captainalm/lib/calmnet/ssl/SSLUtilities.html b/JavaDoc/com/captainalm/lib/calmnet/ssl/SSLUtilities.html
index 4cbf705..e783810 100644
--- a/JavaDoc/com/captainalm/lib/calmnet/ssl/SSLUtilities.html
+++ b/JavaDoc/com/captainalm/lib/calmnet/ssl/SSLUtilities.html
@@ -2,9 +2,9 @@
-
+
SSLUtilities
-
+
diff --git a/JavaDoc/com/captainalm/lib/calmnet/ssl/SSLUtilityException.html b/JavaDoc/com/captainalm/lib/calmnet/ssl/SSLUtilityException.html
index 7f0d363..d88140f 100644
--- a/JavaDoc/com/captainalm/lib/calmnet/ssl/SSLUtilityException.html
+++ b/JavaDoc/com/captainalm/lib/calmnet/ssl/SSLUtilityException.html
@@ -2,9 +2,9 @@
-
+
SSLUtilityException
-
+
diff --git a/JavaDoc/com/captainalm/lib/calmnet/ssl/package-frame.html b/JavaDoc/com/captainalm/lib/calmnet/ssl/package-frame.html
index 046d3b2..1148232 100644
--- a/JavaDoc/com/captainalm/lib/calmnet/ssl/package-frame.html
+++ b/JavaDoc/com/captainalm/lib/calmnet/ssl/package-frame.html
@@ -2,9 +2,9 @@
-
+
com.captainalm.lib.calmnet.ssl
-
+
diff --git a/JavaDoc/com/captainalm/lib/calmnet/ssl/package-summary.html b/JavaDoc/com/captainalm/lib/calmnet/ssl/package-summary.html
index 919cbe3..e9d5fdb 100644
--- a/JavaDoc/com/captainalm/lib/calmnet/ssl/package-summary.html
+++ b/JavaDoc/com/captainalm/lib/calmnet/ssl/package-summary.html
@@ -2,9 +2,9 @@
-
+
com.captainalm.lib.calmnet.ssl
-
+
diff --git a/JavaDoc/com/captainalm/lib/calmnet/ssl/package-tree.html b/JavaDoc/com/captainalm/lib/calmnet/ssl/package-tree.html
index 90c322b..d206828 100644
--- a/JavaDoc/com/captainalm/lib/calmnet/ssl/package-tree.html
+++ b/JavaDoc/com/captainalm/lib/calmnet/ssl/package-tree.html
@@ -2,9 +2,9 @@
-
+
com.captainalm.lib.calmnet.ssl Class Hierarchy
-
+
diff --git a/JavaDoc/com/captainalm/lib/calmnet/stream/LengthClampedInputStream.html b/JavaDoc/com/captainalm/lib/calmnet/stream/LengthClampedInputStream.html
index e094aa5..f34ba4d 100644
--- a/JavaDoc/com/captainalm/lib/calmnet/stream/LengthClampedInputStream.html
+++ b/JavaDoc/com/captainalm/lib/calmnet/stream/LengthClampedInputStream.html
@@ -2,9 +2,9 @@
-
+
LengthClampedInputStream
-
+
diff --git a/JavaDoc/com/captainalm/lib/calmnet/stream/NetworkInputStream.html b/JavaDoc/com/captainalm/lib/calmnet/stream/NetworkInputStream.html
index 1c228d0..16068b6 100644
--- a/JavaDoc/com/captainalm/lib/calmnet/stream/NetworkInputStream.html
+++ b/JavaDoc/com/captainalm/lib/calmnet/stream/NetworkInputStream.html
@@ -2,9 +2,9 @@
-
+
NetworkInputStream
-
+
diff --git a/JavaDoc/com/captainalm/lib/calmnet/stream/NetworkOutputStream.html b/JavaDoc/com/captainalm/lib/calmnet/stream/NetworkOutputStream.html
index 08bb362..958e450 100644
--- a/JavaDoc/com/captainalm/lib/calmnet/stream/NetworkOutputStream.html
+++ b/JavaDoc/com/captainalm/lib/calmnet/stream/NetworkOutputStream.html
@@ -2,9 +2,9 @@
-
+
NetworkOutputStream
-
+
diff --git a/JavaDoc/com/captainalm/lib/calmnet/stream/package-frame.html b/JavaDoc/com/captainalm/lib/calmnet/stream/package-frame.html
index 29be9a5..abb063a 100644
--- a/JavaDoc/com/captainalm/lib/calmnet/stream/package-frame.html
+++ b/JavaDoc/com/captainalm/lib/calmnet/stream/package-frame.html
@@ -2,9 +2,9 @@
-
+
com.captainalm.lib.calmnet.stream
-
+
diff --git a/JavaDoc/com/captainalm/lib/calmnet/stream/package-summary.html b/JavaDoc/com/captainalm/lib/calmnet/stream/package-summary.html
index 2d915a2..bfebec9 100644
--- a/JavaDoc/com/captainalm/lib/calmnet/stream/package-summary.html
+++ b/JavaDoc/com/captainalm/lib/calmnet/stream/package-summary.html
@@ -2,9 +2,9 @@
-
+
com.captainalm.lib.calmnet.stream
-
+
diff --git a/JavaDoc/com/captainalm/lib/calmnet/stream/package-tree.html b/JavaDoc/com/captainalm/lib/calmnet/stream/package-tree.html
index bae0857..c44af43 100644
--- a/JavaDoc/com/captainalm/lib/calmnet/stream/package-tree.html
+++ b/JavaDoc/com/captainalm/lib/calmnet/stream/package-tree.html
@@ -2,9 +2,9 @@
-
+
com.captainalm.lib.calmnet.stream Class Hierarchy
-
+
diff --git a/JavaDoc/constant-values.html b/JavaDoc/constant-values.html
index acae834..e3e704b 100644
--- a/JavaDoc/constant-values.html
+++ b/JavaDoc/constant-values.html
@@ -2,9 +2,9 @@
-
+
Constant Field Values
-
+
diff --git a/JavaDoc/deprecated-list.html b/JavaDoc/deprecated-list.html
index b09d04a..160555e 100644
--- a/JavaDoc/deprecated-list.html
+++ b/JavaDoc/deprecated-list.html
@@ -2,9 +2,9 @@
-
+
Deprecated List
-
+
diff --git a/JavaDoc/help-doc.html b/JavaDoc/help-doc.html
index 2b74811..5aef9e3 100644
--- a/JavaDoc/help-doc.html
+++ b/JavaDoc/help-doc.html
@@ -2,9 +2,9 @@
-
+
API Help
-
+
diff --git a/JavaDoc/index-files/index-1.html b/JavaDoc/index-files/index-1.html
index 8ee2578..4f32d80 100644
--- a/JavaDoc/index-files/index-1.html
+++ b/JavaDoc/index-files/index-1.html
@@ -2,9 +2,9 @@
-
+
A-Index
-
+
@@ -77,6 +77,10 @@
Whether the candidate should be accepted.
+addMostSignificantFlag(int) - Static method in class com.captainalm.lib.calmnet.packet.PacketLoader
+
+Adds the most significant flag to the given integer.
+
address - Variable in class com.captainalm.lib.calmnet.marshal.CandidateClient
The remote address of the candidate.
diff --git a/JavaDoc/index-files/index-10.html b/JavaDoc/index-files/index-10.html
index 1a75c9f..1ee7230 100644
--- a/JavaDoc/index-files/index-10.html
+++ b/JavaDoc/index-files/index-10.html
@@ -2,9 +2,9 @@
-
+
L-Index
-
+
diff --git a/JavaDoc/index-files/index-11.html b/JavaDoc/index-files/index-11.html
index b00c2ef..9ff5465 100644
--- a/JavaDoc/index-files/index-11.html
+++ b/JavaDoc/index-files/index-11.html
@@ -2,9 +2,9 @@
-
+
M-Index
-
+
diff --git a/JavaDoc/index-files/index-12.html b/JavaDoc/index-files/index-12.html
index 7860b7c..8d513b0 100644
--- a/JavaDoc/index-files/index-12.html
+++ b/JavaDoc/index-files/index-12.html
@@ -2,9 +2,9 @@
-
+
N-Index
-
+
diff --git a/JavaDoc/index-files/index-13.html b/JavaDoc/index-files/index-13.html
index 8a9184f..80097dd 100644
--- a/JavaDoc/index-files/index-13.html
+++ b/JavaDoc/index-files/index-13.html
@@ -2,9 +2,9 @@
-
+
O-Index
-
+
diff --git a/JavaDoc/index-files/index-14.html b/JavaDoc/index-files/index-14.html
index fc32a85..14eced4 100644
--- a/JavaDoc/index-files/index-14.html
+++ b/JavaDoc/index-files/index-14.html
@@ -2,9 +2,9 @@
-
+
P-Index
-
+
@@ -105,6 +105,11 @@
Constructs a new Packet loader instance with the specified DigestProvider
.
+ PacketLoader(DigestProvider, boolean) - Constructor for class com.captainalm.lib.calmnet.packet.PacketLoader
+
+Constructs a new Packet loader instance with the specified DigestProvider
+ and if the old packet format should be used.
+
PacketProtocolInformation - Class in com.captainalm.lib.calmnet.packet
This class provides the packet protocol information for IPacket
.
diff --git a/JavaDoc/index-files/index-15.html b/JavaDoc/index-files/index-15.html
index a3bd50e..7991add 100644
--- a/JavaDoc/index-files/index-15.html
+++ b/JavaDoc/index-files/index-15.html
@@ -2,9 +2,9 @@
-
+
R-Index
-
+
@@ -89,6 +89,10 @@
Reads a byte from an InputStream
.
+ readByteIntegerFromInputStream(InputStream) - Static method in class com.captainalm.lib.calmnet.packet.PacketLoader
+
+Reads a byte (In int form) from an InputStream
.
+
readData(OutputStream) - Method in class com.captainalm.lib.calmnet.packet.core.Base64Packet
Reads payload data to an OutputStream
.
diff --git a/JavaDoc/index-files/index-16.html b/JavaDoc/index-files/index-16.html
index 30e3051..997120d 100644
--- a/JavaDoc/index-files/index-16.html
+++ b/JavaDoc/index-files/index-16.html
@@ -2,9 +2,9 @@
-
+
S-Index
-
+
@@ -250,6 +250,10 @@
Sets the number of FragmentReceiver.sendPacket()
calls, that return null, to a registry entry are made before
the FragmentSendCompletePacket
or FragmentRetrySendPacket
packets are sent.
+setOldPacketFormatUsage(boolean) - Method in class com.captainalm.lib.calmnet.packet.PacketLoader
+
+Sets if the old packet format should be used (No explicit hash indication nor length).
+
setOpenedConsumer(Consumer<NetMarshalClient>) - Method in class com.captainalm.lib.calmnet.marshal.NetMarshalServer
Sets the Consumer
opened consumer.
@@ -308,19 +312,19 @@
setResponseVerification(boolean) - Method in class com.captainalm.lib.calmnet.packet.fragment.FragmentReceiver
-Sets whether responses should be verified.
+Sets whether responses should be verified by sending back the payload to be verified.
setResponseVerification(boolean) - Method in class com.captainalm.lib.calmnet.packet.fragment.FragmentSender
-Sets whether responses should be verified.
+Sets whether responses should be verified by checking if they are equal.
setSentDataWillBeAllVerified(boolean) - Method in class com.captainalm.lib.calmnet.packet.fragment.FragmentReceiver
-Gets whether all sent fragments are verified to be equal.
+Gets whether all sent fragments are expected to be verified.
setSentDataWillBeAllVerified(boolean) - Method in class com.captainalm.lib.calmnet.packet.fragment.FragmentSender
-Gets whether all sent fragments are verified to be equal.
+Gets whether all sent fragments are verified via resend checks for equality.
setSocket(Socket) - Method in class com.captainalm.lib.calmnet.stream.NetworkInputStream
@@ -365,19 +369,19 @@
shouldSentDataBeAllVerified() - Method in class com.captainalm.lib.calmnet.packet.fragment.FragmentReceiver
-Gets whether all sent fragments are verified to be equal.
+Gets whether all sent fragments are expected to be verified.
shouldSentDataBeAllVerified() - Method in class com.captainalm.lib.calmnet.packet.fragment.FragmentSender
-Gets whether all sent fragments are verified to be equal.
+Gets whether all sent fragments are verified via resend checks for equality.
shouldVerifyResponses() - Method in class com.captainalm.lib.calmnet.packet.fragment.FragmentReceiver
-Gets whether responses should be verified.
+Gets whether responses should be verified by sending back the payload to be verified.
shouldVerifyResponses() - Method in class com.captainalm.lib.calmnet.packet.fragment.FragmentSender
-Gets whether responses should be verified.
+Gets whether responses should be verified by checking if they are equal.
sslUpgradeClientSide(SSLContext, String) - Method in class com.captainalm.lib.calmnet.marshal.NetMarshalClient
@@ -429,6 +433,10 @@
Stops data verification for the specified Packet ID when FragmentSender.shouldSentDataBeAllVerified()
is true.
+ subtractMostSignificantFlag(int) - Static method in class com.captainalm.lib.calmnet.packet.PacketLoader
+
+Subtracts the most significant flag from the given integer.
+
A B C D E F G H I L M N O P R S U V W
diff --git a/JavaDoc/index-files/index-17.html b/JavaDoc/index-files/index-17.html
index b5a014d..bc79195 100644
--- a/JavaDoc/index-files/index-17.html
+++ b/JavaDoc/index-files/index-17.html
@@ -2,9 +2,9 @@
-
+
U-Index
-
+
diff --git a/JavaDoc/index-files/index-18.html b/JavaDoc/index-files/index-18.html
index 18eeddf..f6caf07 100644
--- a/JavaDoc/index-files/index-18.html
+++ b/JavaDoc/index-files/index-18.html
@@ -2,9 +2,9 @@
-
+
V-Index
-
+
diff --git a/JavaDoc/index-files/index-19.html b/JavaDoc/index-files/index-19.html
index 88e0d53..72c2cd9 100644
--- a/JavaDoc/index-files/index-19.html
+++ b/JavaDoc/index-files/index-19.html
@@ -2,9 +2,9 @@
-
+
W-Index
-
+
diff --git a/JavaDoc/index-files/index-2.html b/JavaDoc/index-files/index-2.html
index 21338bf..d6a6fd2 100644
--- a/JavaDoc/index-files/index-2.html
+++ b/JavaDoc/index-files/index-2.html
@@ -2,9 +2,9 @@
-
+
B-Index
-
+
diff --git a/JavaDoc/index-files/index-3.html b/JavaDoc/index-files/index-3.html
index c6671cf..27e1323 100644
--- a/JavaDoc/index-files/index-3.html
+++ b/JavaDoc/index-files/index-3.html
@@ -2,9 +2,9 @@
-
+
C-Index
-
+
diff --git a/JavaDoc/index-files/index-4.html b/JavaDoc/index-files/index-4.html
index d117334..b2a2abe 100644
--- a/JavaDoc/index-files/index-4.html
+++ b/JavaDoc/index-files/index-4.html
@@ -2,9 +2,9 @@
-
+
D-Index
-
+
diff --git a/JavaDoc/index-files/index-5.html b/JavaDoc/index-files/index-5.html
index 45c95ae..d6d58ba 100644
--- a/JavaDoc/index-files/index-5.html
+++ b/JavaDoc/index-files/index-5.html
@@ -2,9 +2,9 @@
-
+
E-Index
-
+
diff --git a/JavaDoc/index-files/index-6.html b/JavaDoc/index-files/index-6.html
index c30b5ab..1e57f0d 100644
--- a/JavaDoc/index-files/index-6.html
+++ b/JavaDoc/index-files/index-6.html
@@ -2,9 +2,9 @@
-
+
F-Index
-
+
diff --git a/JavaDoc/index-files/index-7.html b/JavaDoc/index-files/index-7.html
index 71b2a35..f730d22 100644
--- a/JavaDoc/index-files/index-7.html
+++ b/JavaDoc/index-files/index-7.html
@@ -2,9 +2,9 @@
-
+
G-Index
-
+
diff --git a/JavaDoc/index-files/index-8.html b/JavaDoc/index-files/index-8.html
index d1ccf41..735064d 100644
--- a/JavaDoc/index-files/index-8.html
+++ b/JavaDoc/index-files/index-8.html
@@ -2,9 +2,9 @@
-
+
H-Index
-
+
diff --git a/JavaDoc/index-files/index-9.html b/JavaDoc/index-files/index-9.html
index 1e6942f..c955650 100644
--- a/JavaDoc/index-files/index-9.html
+++ b/JavaDoc/index-files/index-9.html
@@ -2,9 +2,9 @@
-
+
I-Index
-
+
@@ -130,6 +130,10 @@
Gets if the internal cache is used.
+isOldPacketFormatInUse() - Method in class com.captainalm.lib.calmnet.packet.PacketLoader
+
+Is the old packet format in use (No explicit hash indication nor length).
+
isRunning() - Method in class com.captainalm.lib.calmnet.marshal.NetMarshalClient
Gets if the marshal is running.
diff --git a/JavaDoc/index.html b/JavaDoc/index.html
index 946e0dd..c8248ac 100644
--- a/JavaDoc/index.html
+++ b/JavaDoc/index.html
@@ -2,7 +2,7 @@
-
+
Generated Documentation (Untitled)
diff --git a/JavaDoc/overview-summary.html b/JavaDoc/overview-summary.html
index 6132965..a459436 100644
--- a/JavaDoc/overview-summary.html
+++ b/JavaDoc/overview-summary.html
@@ -2,9 +2,9 @@
-
+
Overview
-
+
diff --git a/JavaDoc/overview-tree.html b/JavaDoc/overview-tree.html
index 5d06f19..0fc6259 100644
--- a/JavaDoc/overview-tree.html
+++ b/JavaDoc/overview-tree.html
@@ -2,9 +2,9 @@
-
+
Class Hierarchy
-
+
diff --git a/JavaDoc/serialized-form.html b/JavaDoc/serialized-form.html
index 2a488a4..7ed73df 100644
--- a/JavaDoc/serialized-form.html
+++ b/JavaDoc/serialized-form.html
@@ -2,9 +2,9 @@
-
+
Serialized Form
-
+
diff --git a/src/com/captainalm/lib/calmnet/packet/PacketLoader.java b/src/com/captainalm/lib/calmnet/packet/PacketLoader.java
index 9c49949..e27bd16 100644
--- a/src/com/captainalm/lib/calmnet/packet/PacketLoader.java
+++ b/src/com/captainalm/lib/calmnet/packet/PacketLoader.java
@@ -327,6 +327,7 @@ public class PacketLoader {
*
* @param packet The packet to save.
* @param writeInformation Write the {@link PacketProtocolInformation} to the beginning of the array.
+ * @return The written packet data as a byte array.
* @throws NullPointerException A parameter is null.
* @throws PacketException An Exception has occurred.
*/
@@ -449,13 +450,13 @@ public class PacketLoader {
* @param outputStream The output stream to use.
* @param i The integer to store.
* @throws NullPointerException outputStream is null.
- * @throws IllegalArgumentException i is less than 0.
* @throws IOException An I/O error has occurred.
*/
public static void writeInteger(OutputStream outputStream, int i) throws IOException {
if (outputStream == null) throw new NullPointerException("outputStream is null");
- if (i < 0) throw new IllegalArgumentException("i is less than 0");
- outputStream.write(i / 16777216);
+ boolean neg = i < 0;
+ if (i < 0) i = -(Integer.MIN_VALUE - i);
+ outputStream.write((i / 16777216) + ((neg) ? 128 : 0));
i %= 16777216;
outputStream.write(i / 65536);
i %= 65536;
@@ -521,12 +522,12 @@ public class PacketLoader {
*
* @param i The integer to save.
* @return The byte array.
- * @throws IllegalArgumentException i is less than 0.
*/
public static byte[] getByteArrayFromInteger(int i) {
- if (i < 0) throw new IllegalArgumentException("i is less than 0");
+ boolean neg = i < 0;
+ if (i < 0) i = -(Integer.MIN_VALUE - i);
byte[] toret = new byte[4];
- toret[0] = (byte) (i / 16777216);
+ toret[0] = (byte) ((i / 16777216) + ((neg) ? 128 : 0));
i %= 16777216;
toret[1] = (byte) (i / 65536);
i %= 65536;
diff --git a/src/com/captainalm/lib/calmnet/packet/core/EncryptedPacket.java b/src/com/captainalm/lib/calmnet/packet/core/EncryptedPacket.java
index 0b5b1b5..8ef7be0 100644
--- a/src/com/captainalm/lib/calmnet/packet/core/EncryptedPacket.java
+++ b/src/com/captainalm/lib/calmnet/packet/core/EncryptedPacket.java
@@ -84,6 +84,7 @@ public class EncryptedPacket implements IStreamedPacket, IInternalCache {
* @param factory The packet factory to use.
* @param loader The Packet Loader to use.
* @param cipherFactory The cipher factory to use.
+ * @param packet The packet to use.
* @throws NullPointerException factory, loader or cipherFactory is null.
*/
public EncryptedPacket(IPacketFactory factory, PacketLoader loader, ICipherFactory cipherFactory, IPacket packet) {
@@ -97,6 +98,7 @@ public class EncryptedPacket implements IStreamedPacket, IInternalCache {
* @param factory The packet factory to use.
* @param loader The Packet Loader to use.
* @param cipherFactory The cipher factory to use.
+ * @param packet The packet to use.
* @param useCache If the encrypted data should be cached.
* @throws NullPointerException factory, loader or cipherFactory is null.
*/