Package org.aoju.bus.core.io.resource
Class BytesResource
java.lang.Object
org.aoju.bus.core.io.resource.BytesResource
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetName()获取资源名,例如文件资源的资源名为文件名获得InputStreamgetUrl()获得解析后的URLbyte[]读取资源内容,读取完毕后会关闭流 关闭流并不影响下一次读取readString(Charset charset) 读取资源内容,读取完毕后会关闭流 关闭流并不影响下一次读取Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.aoju.bus.core.io.resource.Resource
getReader, isModified, writeTo
-
Constructor Details
-
BytesResource
public BytesResource(byte[] bytes) 构造- Parameters:
bytes- 字节数组
-
BytesResource
-
-
Method Details
-
getName
-
getUrl
-
getStream
Description copied from interface:Resource获得InputStream- Specified by:
getStreamin interfaceResource- Returns:
InputStream
-
readString
Description copied from interface:Resource读取资源内容,读取完毕后会关闭流 关闭流并不影响下一次读取- Specified by:
readStringin interfaceResource- Parameters:
charset- 编码- Returns:
- 读取资源内容
- Throws:
InternalException- 包装IOException
-
readBytes
Description copied from interface:Resource读取资源内容,读取完毕后会关闭流 关闭流并不影响下一次读取- Specified by:
readBytesin interfaceResource- Returns:
- 读取资源内容
- Throws:
InternalException- 包装IOException
-