Read() public static method

public static Read ( BinaryReader reader, System.IO.FileType expectedType ) : FileMetadata
reader System.IO.BinaryReader
expectedType System.IO.FileType
return FileMetadata
Beispiel #1
0
 public static FileMetadata Read(BinaryReader reader, FileType expectedType)
 {
   FileMetadata fileMetadata = new FileMetadata();
   fileMetadata.Read(reader);
   if (fileMetadata.Type != expectedType)
     throw new FileFormatException("Expected type \"" + Enum.GetName(typeof (FileType), (object) expectedType) + "\" but found \"" + Enum.GetName(typeof (FileType), (object) fileMetadata.Type) + "\".");
   return fileMetadata;
 }
Beispiel #2
0
        public static FileMetadata Read(BinaryReader reader, FileType expectedType)
        {
            FileMetadata fileMetadata = new FileMetadata();
            fileMetadata.Read(reader);
            if (fileMetadata.Type != expectedType)
                throw new Exception("Expected type \"" + Enum.GetName(typeof(FileType), expectedType) + "\" but found \"" + Enum.GetName(typeof(FileType), fileMetadata.Type) + "\".");

            return fileMetadata;
        }
 public static FileMetadata Read(BinaryReader reader, FileType expectedType)
 {
     FileMetadata fileMetadatum = new FileMetadata();
     fileMetadatum.Read(reader);
     if (fileMetadatum.Type != expectedType)
     {
         string[] name = new string[] { "Expected type \"", Enum.GetName(typeof(FileType), expectedType), "\" but found \"", Enum.GetName(typeof(FileType), fileMetadatum.Type), "\"." };
         throw new Exception("FileFormatException: " + string.Concat(name));
     }
     return fileMetadatum;
 }
Beispiel #4
0
        public static FileMetadata Read(BinaryReader reader, FileType expectedType)
        {
            FileMetadata fileMetadata = new FileMetadata();

            fileMetadata.Read(reader);
            if (fileMetadata.Type != expectedType)
            {
                throw new Exception("Expected type \"" + Enum.GetName(typeof(FileType), expectedType) + "\" but found \"" + Enum.GetName(typeof(FileType), fileMetadata.Type) + "\".");
            }

            return(fileMetadata);
        }
        public static FileMetadata Read(BinaryReader reader, FileType expectedType)
        {
            FileMetadata fileMetadatum = new FileMetadata();

            fileMetadatum.Read(reader);
            if (fileMetadatum.Type != expectedType)
            {
                string[] name = new string[] { "Expected type \"", Enum.GetName(typeof(FileType), expectedType), "\" but found \"", Enum.GetName(typeof(FileType), fileMetadatum.Type), "\"." };
                throw new Exception("FileFormatException: " + string.Concat(name));
            }
            return(fileMetadatum);
        }