大家好我是抹茶今天給大家?guī)怼癷App取文件CRC值”嚼沿!
我們來看一下效果:
如何實(shí)現(xiàn)呢我們來看一下代碼!
調(diào)用java獲取CRC代碼
t()
{
//這里用了iApp的圖標(biāo)當(dāng)文件。
fdir("@icon_iapp.png",path)
javanew(file,"java.io.File","String",path)
javanew(crc32,"java.util.zip.CRC32")
javanew(is,"java.io.FileInputStream","java.io.File",file)
javanew(cis,"java.util.zip.CheckedInputStream","java.io.InputStream",is,"java.util.zip.Checksum",crc32)
java(length,cis,"java.util.zip.CheckedInputStream.read")
w(length>=0)
{
java(length,cis,"java.util.zip.CheckedInputStream.read")
}
java(null,cis,"java.io.FilterInputStream.close")
java(value,crc32,"java.util.zip.CRC32.getValue")
java(value,null,"java.lang.Long.toHexString","long",value)
ufnsui()
{
us(3,"text",value)
}
}
tw("計(jì)算中請勿退出")
今天教程就到這里骤菠,感謝閱讀本文章!