Commit 44c1b74e authored by Jean Meurice's avatar Jean Meurice
Browse files

readNBytes() replacement

parent 437bc95e
Pipeline #381147 passed with stage
in 37 seconds
......@@ -96,7 +96,10 @@ public class SimplePacketType extends DataType {
public Object fromBinary(DataInputStream is) throws IOException {
Object res[] = new Object[2];
short addrSize = is.readShort();
res[0] = new String(is.readNBytes(addrSize));
//res[0] = new String(is.readNBytes(addrSize));
byte bytes[] = new byte[addrSize];
for (int i = 0; i < addrSize; ++i) bytes[i] = is.readByte();
res[0] = new String(bytes);
res[1] = payloadType.fromBinary(is);
return res;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment