Back to Vassonic

SonicFileUtils (sdk 3.0.0 API)

sonic-android/docs/javadoc/com/tencent/sonic/sdk/SonicFileUtils.html

3.1.14.4 KB
Original Source

跳过导航链接

com.tencent.sonic.sdk

类 SonicFileUtils

  • java.lang.Object

    • com.tencent.sonic.sdk.SonicFileUtils

public classSonicFileUtilsextends java.lang.Object

Interact with the overall file operations.

构造器概要

构造器 | 构造器和说明 | | --- | | SonicFileUtils() |

方法概要

所有方法 静态方法 具体方法 | 限定符和类型 | 方法和说明 | | --- | --- | | static java.util.Map<java.lang.String,java.util.List<java.lang.String>> | getHeaderFromLocalCache(java.lang.String headerPath) Get headers from local cache file | | static java.lang.String | getSonicResourceHeaderPath(java.lang.String resourceName) | | static java.lang.String | getSonicResourcePath(java.lang.String resourceName) | | static byte[] | readFileToBytes(java.io.File file) | | static boolean | verifyData(byte[] content, java.lang.String targetSha1) This method computes hash value by using specified SHA1 digest algorithm and compares hash value to the specified hash @{code targetSha1}. |

- 

从类继承的方法 java.lang.Object

clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

构造器详细资料

- 

SonicFileUtils

public SonicFileUtils()

方法详细资料

- 

getSonicResourcePath

public static java.lang.String getSonicResourcePath(java.lang.String resourceName)

参数:resourceName - resource file name返回:The path of the resource file.

- 

getSonicResourceHeaderPath

public static java.lang.String getSonicResourceHeaderPath(java.lang.String resourceName)

参数:resourceName - resource file name返回:The path of the resource header file.

- 

verifyData

public static boolean verifyData(byte[] content,
                                 java.lang.String targetSha1)

This method computes hash value by using specified SHA1 digest algorithm and compares hash value to the specified hash @{code targetSha1}. 参数:content - Data bytestargetSha1 - The specified hash value返回:true if the given hash value equivalent to computed hash value, false otherwise

- 

readFileToBytes

public static byte[] readFileToBytes(java.io.File file)

参数:file - path of the file to read返回:Returns the content bytes read from the file.

- 

getHeaderFromLocalCache

public static java.util.Map<java.lang.String,java.util.List<java.lang.String>> getHeaderFromLocalCache(java.lang.String headerPath)

Get headers from local cache file 参数:headerPath - header file path返回:The last http response headers from local cache.

跳过导航链接