public static byte get_byte(Stream infile) { int b = infile.ReadByte(); ErrorStuff.CHECK_FILE(b == -1, infile, "fread"); return((byte)b); }
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)); }
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)); }
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)); }
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"); }