// Operates on a socket, which we don't want to close; suppress the warning
@SuppressWarnings("resource")
BNetInputStream is = new BNetInputStream(rawis);
packetLength = is.readWord() & 0x0000FFFF;
packetId = BNLSPacketId.values()[is.readByte() & 0x000000FF];
assert(packetLength >= 3);
data = new byte[packetLength-3];
for(int i = 0; i < packetLength-3; i++)
data[i] = is.readByte();