Exemplo n.º 1
0
 private void FixBufferCRC32(ref CR2WBuffer buffer)
 {
     //This might throw errors, the way it should be checked for is by reading
     //the object tree to find the deferred data buffers that will point to a buffer.
     //The flag of the parent object indicates where to read the data from.
     //For now this is a crude workaround.
     if (m_hasInternalBuffer)
     {
         m_stream.Seek(buffer.offset, SeekOrigin.Begin);
         m_temp = new byte[buffer.diskSize];
         m_stream.Read(m_temp, 0, m_temp.Length);
         buffer.crc32 = Crc32Algorithm.Compute(m_temp);
     }
     else
     {
         var path = String.Format("{0}.{1}.buffer", m_filePath, buffer.index);
         if (!File.Exists(path))
         {
             return;
         }
         m_temp       = File.ReadAllBytes(path);
         buffer.crc32 = Crc32Algorithm.Compute(m_temp);
     }
 }
Exemplo n.º 2
0
 public CR2WBufferWrapper(CR2WBuffer buffer)
 {
     _buffer = buffer;
 }
Exemplo n.º 3
0
 public CR2WBufferWrapper()
 {
     _buffer = new CR2WBuffer();
 }