public interface Resource
限定符和类型 | 方法和说明 |
---|---|
BufferedReader |
getReader(Charset charset)
获得Reader
|
InputStream |
getStream()
获得
InputStream |
URL |
getUrl()
获得解析后的
URL |
byte[] |
readBytes()
读取资源内容,读取完毕后会关闭流
关闭流并不影响下一次读取 |
String |
readStr(Charset charset)
读取资源内容,读取完毕后会关闭流
关闭流并不影响下一次读取 |
String |
readUtf8Str()
读取资源内容,读取完毕后会关闭流
关闭流并不影响下一次读取 |
InputStream getStream()
InputStream
InputStream
BufferedReader getReader(Charset charset)
charset
- 编码BufferedReader
String readStr(Charset charset) throws IORuntimeException
charset
- 编码IORuntimeException
- 包装IOException
String readUtf8Str() throws IORuntimeException
IORuntimeException
- 包装IOExceptionbyte[] readBytes() throws IORuntimeException
IORuntimeException
- 包装IOExceptionCopyright © 2021. All rights reserved.