public void ReadFrom(byte[] buf, int offset) { this.Flags = (PackageHeadFlags)buf[offset]; this.MessageLength = BitConverter.ToUInt16(buf, offset + sizeof(PackageHeadFlags)); }