コード例 #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));
 }
コード例 #2
0
ファイル: RiffChunk.cs プロジェクト: malebra/Opyum
 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));
 }
コード例 #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));
 }
コード例 #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);
        }
コード例 #5
0
ファイル: RiffChunk.cs プロジェクト: malebra/Opyum
        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);
        }
コード例 #6
0
		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;
		}
コード例 #7
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);
		}