Esempio n. 1
0
        public static byte get_byte(Stream infile)
        {
            int b = infile.ReadByte();

            ErrorStuff.CHECK_FILE(b == -1, infile, "fread");
            return((byte)b);
        }
Esempio n. 2
0
        public static ulong get_64_be(Stream infile)
        {
            byte[] buf        = new byte[8];
            int    bytes_read = infile.Read(buf, 0, 8);

            ErrorStuff.CHECK_FILE(bytes_read != 8, infile, "fread");
            return(read_64_be(buf));
        }
Esempio n. 3
0
        public static uint get_32_le(Stream infile)
        {
            byte[] buf        = new byte[4];
            int    bytes_read = infile.Read(buf, 0, 4);

            ErrorStuff.CHECK_FILE(bytes_read != 4, infile, "fread");
            return(read_32_le(buf));
        }
Esempio n. 4
0
        public static ushort get_16_le(Stream infile)
        {
            byte[] buf        = new byte[2];
            int    bytes_read = infile.Read(buf, 0, 2);

            ErrorStuff.CHECK_FILE(bytes_read != 2, infile, "fread");
            return(read_16_le(buf));
        }
Esempio n. 5
0
        public static void get_bytes(Stream infile, byte[] buf, long byte_count)
        {
            int bytes_read = infile.Read(buf, 0, (int)byte_count);

            ErrorStuff.CHECK_FILE(bytes_read != byte_count, infile, "fread");
        }