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); } }
public CR2WBufferWrapper(CR2WBuffer buffer) { _buffer = buffer; }
public CR2WBufferWrapper() { _buffer = new CR2WBuffer(); }