Exemplo n.º 1
0
        //--------------------------------------------------------------------------------------

        public static string GetUTF(Stream data)
        {
            int len = GetU16(data);

            if (len > 0)
            {
                byte[] buff = IOUtil.ReadExpect(data, len);
                return(System.Text.UTF8Encoding.UTF8.GetString(buff, 0, len));
            }
            return(null);
        }
Exemplo n.º 2
0
 public static double GetF64(Stream data)
 {
     byte[] buff = IOUtil.ReadExpect(data, 8);
     return(System.BitConverter.ToDouble(buff, 0));
 }
Exemplo n.º 3
0
        //--------------------------------------------------------------------------------------

        public static float GetF32(Stream data)
        {
            byte[] buff = IOUtil.ReadExpect(data, 4);
            return(System.BitConverter.ToSingle(buff, 0));
        }