44import net .sharksystem .asap .ASAPSecurityException ;
55import net .sharksystem .crypto .ASAPCryptoAlgorithms ;
66import net .sharksystem .crypto .BasicCryptoParameters ;
7- import net .sharksystem .utils .Serialization ;
7+ import net .sharksystem .utils .ASAPSerialization ;
88
99import java .io .ByteArrayInputStream ;
1010import java .io .ByteArrayOutputStream ;
@@ -37,18 +37,18 @@ static byte[] serializeMessage(byte[] message, CharSequence topic, CharSequence
3737
3838 // merge content, sender and recipient
3939 ByteArrayOutputStream baos = new ByteArrayOutputStream ();
40- Serialization .writeByteArray (message , baos );
41- Serialization .writeCharSequenceParameter (ownerID , baos );
42- Serialization .writeCharSequenceParameter (recipient , baos );
40+ ASAPSerialization .writeByteArray (message , baos );
41+ ASAPSerialization .writeCharSequenceParameter (ownerID , baos );
42+ ASAPSerialization .writeCharSequenceParameter (recipient , baos );
4343 message = baos .toByteArray ();
4444
4545 byte flags = 0 ;
4646 if (sign ) {
4747 byte [] signature = ASAPCryptoAlgorithms .sign (message , basicCryptoParameters );
4848 baos = new ByteArrayOutputStream ();
49- Serialization .writeByteArray (message , baos ); // message has three parts: content, sender, receiver
49+ ASAPSerialization .writeByteArray (message , baos ); // message has three parts: content, sender, receiver
5050 // append signature
51- Serialization .writeByteArray (signature , baos );
51+ ASAPSerialization .writeByteArray (signature , baos );
5252 // attach signature to message
5353 message = baos .toByteArray ();
5454 flags += SIGNED_MASK ;
@@ -62,8 +62,8 @@ static byte[] serializeMessage(byte[] message, CharSequence topic, CharSequence
6262
6363 // serialize SN message
6464 baos = new ByteArrayOutputStream ();
65- Serialization .writeByteParameter (flags , baos );
66- Serialization .writeByteArray (message , baos );
65+ ASAPSerialization .writeByteParameter (flags , baos );
66+ ASAPSerialization .writeByteArray (message , baos );
6767
6868 return baos .toByteArray ();
6969 }
@@ -72,8 +72,8 @@ static SharkNetMessage parseMessage(byte[] message, String sender, String uri,
7272 CharSequence ownerID , BasicCryptoParameters basicCryptoParameters ) throws IOException , ASAPException {
7373
7474 ByteArrayInputStream bais = new ByteArrayInputStream (message );
75- byte flags = Serialization .readByte (bais );
76- byte [] tmpMessage = Serialization .readByteArray (bais );
75+ byte flags = ASAPSerialization .readByte (bais );
76+ byte [] tmpMessage = ASAPSerialization .readByteArray (bais );
7777
7878 boolean signed = (flags & SIGNED_MASK ) != 0 ;
7979 boolean encrypted = (flags & ENCRYPTED_MASK ) != 0 ;
@@ -99,14 +99,14 @@ static SharkNetMessage parseMessage(byte[] message, String sender, String uri,
9999 if (signed ) {
100100 // split message from signature
101101 bais = new ByteArrayInputStream (tmpMessage );
102- tmpMessage = Serialization .readByteArray (bais );
102+ tmpMessage = ASAPSerialization .readByteArray (bais );
103103 signedMessage = tmpMessage ;
104- signature = Serialization .readByteArray (bais );
104+ signature = ASAPSerialization .readByteArray (bais );
105105 }
106106 bais = new ByteArrayInputStream (tmpMessage );
107- byte [] snMessage = Serialization .readByteArray (bais );
108- String snSender = Serialization .readCharSequenceParameter (bais );
109- String snReceiver = Serialization .readCharSequenceParameter (bais );
107+ byte [] snMessage = ASAPSerialization .readByteArray (bais );
108+ String snSender = ASAPSerialization .readCharSequenceParameter (bais );
109+ String snReceiver = ASAPSerialization .readCharSequenceParameter (bais );
110110
111111 boolean verified = false ; // initialize
112112 if (signature != null ) {
0 commit comments