public void ReadFileChunkReference32(ref FileChunkReference32 fileChunkReference32, string context) { if (!Unsafe.ReadStruct(binaryReader, ref fileChunkReference32)) { throw new FileFormatException("Cannot read ReadFileChunkReference32. Context: " + context); } }
public IFileChunkReference ReadFileChunkReference(StpFormat stpFormat, CbFormat cbFormat, string context) { if (stpFormat == StpFormat.Uncompressed8Bytes && cbFormat == CbFormat.Uncompressed4Bytes) { var fileChunkReference64x32 = new FileChunkReference64x32(); ReadFileChunkReference64x32(ref fileChunkReference64x32, context); return(fileChunkReference64x32); } if (stpFormat == StpFormat.Uncompressed4Bytes && cbFormat == CbFormat.Uncompressed4Bytes) { var fileChunkReference32 = new FileChunkReference32(); ReadFileChunkReference32(ref fileChunkReference32, context); return(fileChunkReference32); } if (stpFormat == StpFormat.Compressed2Bytes && cbFormat == CbFormat.Compressed1Byte) { var fileChunkReference16x8 = new FileChunkReference16x8(); ReadFileChunkReference16x8(ref fileChunkReference16x8, context); return(fileChunkReference16x8); } throw new NotImplementedException("Reference format is not supported"); }