Packets may now be constructed with string input
This commit is contained in:
parent
2a1b317fb1
commit
1ac0d97ce7
@ -35,6 +35,13 @@ public class ProtocolMessage {
|
|||||||
System.arraycopy(message, 0, this.raw, 4, message.length);
|
System.arraycopy(message, 0, this.raw, 4, message.length);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public ProtocolMessage(String message) {
|
||||||
|
this.length = message.length();
|
||||||
|
this.message = message.toCharArray();
|
||||||
|
|
||||||
|
composeRawData(this.length, this.message);
|
||||||
|
}
|
||||||
|
|
||||||
public ProtocolMessage(int length, char[] message) {
|
public ProtocolMessage(int length, char[] message) {
|
||||||
this.length = length;
|
this.length = length;
|
||||||
this.message = message;
|
this.message = message;
|
||||||
|
Loading…
Reference in New Issue
Block a user