Allow multi-byte characters in payload

This commit is contained in:
phantamanta44 2018-12-08 18:04:18 -06:00
parent 075f29dd82
commit 1519b31162
1 changed files with 3 additions and 2 deletions

View File

@ -19,8 +19,9 @@ public class SyncTransport {
public void send(String syncCommand, String name) throws IOException {
if (syncCommand.length() != 4) throw new IllegalArgumentException("sync commands must have length 4");
output.writeBytes(syncCommand);
output.writeInt(Integer.reverseBytes(name.length()));
output.writeBytes(name);
byte[] data = name.getBytes();
output.writeInt(Integer.reverseBytes(data.length));
output.write(data);
}
public void sendStatus(String statusCode, int length) throws IOException {