类 EncodedResource
java.lang.Object
cn.taketoday.core.io.EncodedResource
- 所有已实现的接口:
InputStreamSource
Holder that combines a
Resource descriptor with a specific encoding
or Charset to be used for reading from the resource.
Used as an argument for operations that support reading content with a
specific encoding, typically via a java.io.Reader.
- 从以下版本开始:
- 4.0
- 作者:
- Juergen Hoeller, Sam Brannen, TODAY
2019-12-05 23:17 - 另请参阅:
-
构造器概要
构造器构造器说明EncodedResource(Resource resource) Create a newEncodedResourcefor the givenResource, not specifying an explicit encoding orCharset.EncodedResource(Resource resource, String encoding) Create a newEncodedResourcefor the givenResource, using the specifiedencoding.EncodedResource(Resource resource, Charset charset) Create a newEncodedResourcefor the givenResource, using the specifiedCharset. -
方法概要
修饰符和类型方法说明booleanfinal Charsetfinal StringReturn the encoding to use for reading from the resource, ornullif none specified.final ResourceReturn theResourceheld by thisEncodedResource.inthashCode()booleanDetermine whether aReaderis required as opposed to anInputStream, i.e. whether an encoding or aCharsethas been specified.toString()从接口继承的方法 cn.taketoday.core.io.InputStreamSource
getReader, readableChannel
-
构造器详细资料
-
EncodedResource
Create a newEncodedResourcefor the givenResource, not specifying an explicit encoding orCharset.- 参数:
resource- theResourceto hold (nevernull)
-
EncodedResource
Create a newEncodedResourcefor the givenResource, using the specifiedencoding.- 参数:
resource- theResourceto hold (nevernull)encoding- the encoding to use for reading from the resource
-
EncodedResource
Create a newEncodedResourcefor the givenResource, using the specifiedCharset.- 参数:
resource- theResourceto hold (nevernull)charset- theCharsetto use for reading from the resource
-
-
方法详细资料
-
getResource
Return theResourceheld by thisEncodedResource. -
getEncoding
Return the encoding to use for reading from the resource, ornullif none specified. -
getCharset
-
requiresReader
public boolean requiresReader()Determine whether aReaderis required as opposed to anInputStream, i.e. whether an encoding or aCharsethas been specified.- 另请参阅:
-
getReader
- 指定者:
getReader在接口中InputStreamSource- 抛出:
IOException- if opening the Reader failed- 另请参阅:
-
getInputStream
- 指定者:
getInputStream在接口中InputStreamSource- 返回:
- input stream of
Resourcecontent - 抛出:
IOException- if opening the InputStream failed- 另请参阅:
-
equals
-
hashCode
public int hashCode() -
toString
-