示例#1
0
        private void WriteFloat(TagNodeFloat val)
        {
            byte[] gzBytes = BitConverter.GetBytes(val.Data);

            if (BitConverter.IsLittleEndian)
            {
                Array.Reverse(gzBytes);
            }

            _stream.Write(gzBytes, 0, 4);
        }
示例#2
0
        private TagNode ReadFloat()
        {
            byte[] gzBytes = new byte[4];
            _stream.Read(gzBytes, 0, 4);

            if (BitConverter.IsLittleEndian)
            {
                Array.Reverse(gzBytes);
            }

            TagNodeFloat val = new TagNodeFloat(BitConverter.ToSingle(gzBytes, 0));

            return(val);
        }