public static unpackOutput UnserializeEvent(byte[] buffer) { unpackOutput output = new unpackOutput(); output.eventId = buffer[0]; byte[] tmpBuffer = new byte[buffer.Length - 1]; Buffer.BlockCopy(buffer, 1, tmpBuffer, 0, tmpBuffer.Length); output.data = UnserializeData(tmpBuffer); return(output); }
public static unpackOutput UnserializeInternal(byte[] buffer) { unpackOutput output = new unpackOutput(); output.eventId = buffer[0]; output.methodId = buffer[1]; byte[] tmpBuffer = new byte[buffer.Length - 2]; Buffer.BlockCopy(buffer, 2, tmpBuffer, 0, tmpBuffer.Length); output.data = UnserializeData(tmpBuffer); return(output); }
public static unpackOutput UnserializeRpc(byte[] buffer) { unpackOutput output = new unpackOutput(); output.eventId = buffer[0]; output.objectId = BitConverter.ToUInt16(buffer, 1); output.methodId = buffer[3]; byte[] tmpBuffer = new byte[buffer.Length - 4]; Buffer.BlockCopy(buffer, 4, tmpBuffer, 0, tmpBuffer.Length); output.data = UnserializeData(tmpBuffer); return(output); }