Exemplo n.º 1
0
 public static DataChunk GetDataChunk(Stream stream)
 {
     var dataChunk=new DataChunk();
     var rawData=new byte[8];
     stream.Read(rawData,0,rawData.Length);
     dataChunk.ID=Encoding.ASCII.GetString(rawData.Take(4).ToArray());
     dataChunk.Size=BitConverter.ToInt32(rawData.Skip(4).ToArray(),0);
     return dataChunk;
 }