public static ushort GetPacketId(StreamBuffer buffer) { if (buffer.Buffer.Length < 4) return 0; return BitConverter.ToUInt16(buffer.Buffer, 2); }