Top Level Namespace
Defined Under Namespace
Classes: ExtremeUnZip, ExtremeZip
Instance Method Summary collapse
- #checkMemoryUsage(lineNumber) ⇒ Object
-
#extractVfsDataWithVersion(wholeCbor, fileVersion) ⇒ Object
def extractVfsDataWithVersionExternalFile(wholeCbor, fileVersion) #根据版本号,提取VFS数据内容.
-
#extractVfsDataWithVersionExternalFile(wholeCbor, fileVersion) ⇒ Object
根据版本号,提取VFS数据内容.
Instance Method Details
#checkMemoryUsage(lineNumber) ⇒ Object
12 13 14 15 16 |
# File 'lib/extremezip.zzaqsv.rb', line 12 def checkMemoryUsage(lineNumber) mem = GetProcessMem.new puts("#{lineNumber} , Memory: #{mem.mb}, process id: #{Process.pid}"); # Debug end |
#extractVfsDataWithVersion(wholeCbor, fileVersion) ⇒ Object
def extractVfsDataWithVersionExternalFile(wholeCbor, fileVersion) #根据版本号,提取VFS数据内容
68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 |
# File 'lib/extremeunzip.zzaqsu.rb', line 68 def extractVfsDataWithVersion(wholeCbor, fileVersion) # 根据版本号,提取VFS数据内容 victoriaFreshData = '' # 解压后的数据块整体 if (fileVersion == 14) # 14版本 compressedVfsData = wholeCbor['vfsData'] # 获取压缩后的数据内容 victoriaFreshData = LZMA.decompress(compressedVfsData) # 解压缩数据内容 elsif (fileVersion >= 30) # 30以上版本 compressedVfsDataList = wholeCbor['vfsDataList'] # 获取压缩后的数据块列表 puts("data block amont: #{compressedVfsDataList.length}") # Debug dataBlockCounter = 0 # Data block counter compressedVfsDataList.each do |currentCompressed| # 一块块地解压 puts("data block counter: #{dataBlockCounter}") # Debug checkMemoryUsage(34) currentRawData = LZMA.decompress(currentCompressed) # 解压这一块 # victoriaFreshData=victoriaFreshData+currentRawData #追加 victoriaFreshData << currentRawData # 追加 puts("byte size: #{victoriaFreshData.bytesize}") # debug. dataBlockCounter += 1 # count end # compressedVfsDataList.each do |currentCompressed| end # if (fileVersion==14) #14版本 victoriaFreshData # 返回解压后的数据块整体 end |
#extractVfsDataWithVersionExternalFile(wholeCbor, fileVersion) ⇒ Object
根据版本号,提取VFS数据内容
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 |
# File 'lib/extremeunzip.zzaqsu.rb', line 17 def extractVfsDataWithVersionExternalFile(wholeCbor, fileVersion) victoriaFreshData = '' # 解压后的数据块整体 dataFileName = 'victoriafreshdata.w' # 数据文件名 dataFile = {} # 数据文件对象 if (fileVersion == 14) # 14版本 compressedVfsData = wholeCbor['vfsData'] # 获取压缩后的数据内容 victoriaFreshData = LZMA.decompress(compressedVfsData) # 解压缩数据内容 dataFile = File.open(dataFileName, 'wb') # 打开文件 dataFile.syswrite(victoriaFreshData) # 写入内容 dataFile.close # 关闭文件 elsif (fileVersion >= 30) # 30以上版本 compressedVfsDataList = wholeCbor['vfsDataList'] # 获取压缩后的数据块列表 puts("data block amont: #{compressedVfsDataList.length}") # Debug dataBlockCounter = 0 # Data block counter dataFile = File.open(dataFileName, 'wb') # 打开文件 compressedVfsDataList.each do |currentCompressed| # 一块块地解压 puts("data block counter: #{dataBlockCounter}") # Debug checkMemoryUsage(34) begin # 解压 currentRawData = LZMA.decompress(currentCompressed) # 解压这一块 dataFile.syswrite(currentRawData) # 写入内容 rescue RuntimeError => e # 解压失败 puts "Warning: the exz file may be incomplete." # 报告错误。文件可能不完整。 end # begin # 解压 # victoriaFreshData=victoriaFreshData+currentRawData #追加 # victoriaFreshData << currentRawData #追加 #puts("byte size: #{victoriaFreshData.bytesize}") # debug. dataBlockCounter += 1 # count end # compressedVfsDataList.each do |currentCompressed| dataFile.close # 关闭文件 end # if (fileVersion==14) #14版本 dataFileName # 返回解压后的数据块整体 end |