anchor.diff:    inherited Write(Pointer(Value)^, I);
   end;
   
  +
  +class procedure TKMemoryStream.AsyncSaveToFileAndFree(var aStream: TKMemoryStream;
  +  const aFileName: string; aWorkerThread: TKMWorkerThread);
  +var
  +  LocalStream: TKMemoryStream;
  +begin
  +  LocalStream := aStream;
  +  aWorkerThread.QueueWork(procedure
  +  begin
  +    try
  +      LocalStream.SaveToFile(aFileName);
  +    finally
  +      LocalStream.Free;
  +    end;
  +  end);
  +  aStream := nil;
  +end;
   
   procedure TKMemoryStream.CopyFromDecompression(Source: TStream);
   const
  
positive.code: {$I KaM_Remake.inc}
  interface
  uses
    Classes, SysUtils, KM_Points, KM_CommonTypes;
  
  
  type
  
negative.code:     //ZLib's decompression streams don't work with the normal TStreams.CopyFrom since
      //it uses ReadBuffer. This procedure will work when Source is a TDecompressionStream
      procedure CopyFromDecompression(Source: TStream);
  
      class procedure AsyncSaveToFileAndFree(var aStream: TKMemoryStream; const aFileName: string; aWorkerThread: TKMWorkerThread);
    end;
  
    // Extended with custom Read/Write commands which accept various types without asking for their length
  