Exemple #1
0
 public T GetDataAsStructure <T>(StructureBuilder <T> s)
 {
     this.riffFile.BaseStream.Position = this.dataOffset;
     if ((long)s.Length != (long)((ulong)this.chunkSize))
     {
         throw new InvalidDataException(string.Format("Chunk size is: {0} so can't read structure of: {1}", this.chunkSize, s.Length));
     }
     return(s.Read(this.riffFile));
 }
Exemple #2
0
 public T GetDataAsStructure <T>(StructureBuilder <T> s)
 {
     riffFile.BaseStream.Position = dataOffset;
     if (s.Length != chunkSize)
     {
         throw new InvalidDataException(String.Format("Chunk size is: {0} so can't read structure of: {1}", chunkSize, s.Length));
     }
     return(s.Read(riffFile));
 }
Exemple #3
0
 public object GetDataAsStructure(StructureBuilder s)
 {
     riffFile.BaseStream.Position = dataOffset;
     if (s.Length != chunkSize)
     {
         throw new ApplicationException(String.Format("Chunk size is: {0} so can't read structure of: {1}", chunkSize, s.Length));
     }
     return(s.Read(riffFile));
 }
Exemple #4
0
        public T[] GetDataAsStructureArray <T>(StructureBuilder <T> s)
        {
            this.riffFile.BaseStream.Position = this.dataOffset;
            if ((ulong)this.chunkSize % (ulong)((long)s.Length) != 0UL)
            {
                throw new InvalidDataException(string.Format("Chunk size is: {0} not a multiple of structure size: {1}", this.chunkSize, s.Length));
            }
            int num = (int)((ulong)this.chunkSize / (ulong)((long)s.Length));

            T[] array = new T[num];
            for (int i = 0; i < num; i++)
            {
                array[i] = s.Read(this.riffFile);
            }
            return(array);
        }
Exemple #5
0
        public T[] GetDataAsStructureArray <T>(StructureBuilder <T> s)
        {
            riffFile.BaseStream.Position = dataOffset;
            if (chunkSize % s.Length != 0)
            {
                throw new InvalidDataException(String.Format("Chunk size is: {0} not a multiple of structure size: {1}", chunkSize, s.Length));
            }
            int structuresToRead = (int)(chunkSize / s.Length);

            T[] a = new T[structuresToRead];
            for (int n = 0; n < structuresToRead; n++)
            {
                a[n] = s.Read(riffFile);
            }
            return(a);
        }
		public object[] GetDataAsStructureArray(StructureBuilder s) 
		{
			riffFile.BaseStream.Position = dataOffset;
			if(chunkSize % s.Length != 0) 
			{
				throw new ApplicationException(String.Format("Chunk size is: {0} not a multiple of structure size: {1}",chunkSize,s.Length));
			}
			int structuresToRead = (int) (chunkSize / s.Length);
			object[] a = new object[structuresToRead];
			for(int n = 0; n < structuresToRead; n++) 
			{
				a[n] = s.Read(riffFile);
			}
			return a;
		}
		public object GetDataAsStructure(StructureBuilder s) 
		{
			riffFile.BaseStream.Position = dataOffset;
			if(s.Length != chunkSize) 
			{
				throw new ApplicationException(String.Format("Chunk size is: {0} so can't read structure of: {1}",chunkSize,s.Length));
			}
			return s.Read(riffFile);
		}