public class EncodedResource extends ObjectSE implements InputStreamSource
Resource
記述子を、リソースからの読み取りに使用される特定のエンコードまたは Charset
と組み合わせるホルダー。 通常 java.io.Reader
を介して、特定のエンコーディングでコンテンツを読み取ることをサポートする操作の引数として使用されます。
InputStreamSource.getInputStream()
, Reader
SE, Charset
SEコンストラクターと説明 |
---|
EncodedResource(Resource resource) 明示的なエンコーディングまたは Charset を指定せずに、指定された Resource の新しい EncodedResource を作成します。 |
EncodedResource(Resource resource, CharsetSE charset) 指定された Charset を使用して、指定された Resource の新しい EncodedResource を作成します。 |
EncodedResource(Resource resource, StringSE encoding) 指定された encoding を使用して、指定された Resource の新しい EncodedResource を作成します。 |
修飾子と型 | メソッドと説明 |
---|---|
boolean | equals(ObjectSE other) |
CharsetSE | getCharset() |
StringSE | getEncoding() リソースからの読み取りに使用するエンコーディングを返します。何も指定されていない場合は null を返します。 |
InputStreamSE | getInputStream() |
ReaderSE | getReader() |
Resource | getResource() この EncodedResource が保持する Resource を返します。 |
int | hashCode() |
boolean | requiresReader() InputStream SE ではなく Reader SE が必要かどうかを決定します。 |
StringSE | toString() |
cloneSE, finalizeSE, getClassSE, notifySE, notifyAllSE, waitSE, waitSE, waitSE
public EncodedResource(Resource resource)
Charset
を指定せずに、指定された Resource
の新しい EncodedResource
を作成します。resource
- 保持する Resource
(非 null
)public EncodedResource(Resource resource, @Nullable StringSE encoding)
encoding
を使用して、指定された Resource
の新しい EncodedResource
を作成します。resource
- 保持する Resource
(非 null
)encoding
- リソースからの読み取りに使用するエンコーディング public final Resource getResource()
EncodedResource
が保持する Resource
を返します。@Nullable public final StringSE getEncoding()
null
を返します。public boolean requiresReader()
getReader()
, getInputStream()
public ReaderSE getReader() throws IOExceptionSE
IOExceptionSE
- リーダーのオープンに失敗した場合 requiresReader()
, getInputStream()
public InputStreamSE getInputStream() throws IOExceptionSE
InputStreamSource
の getInputStream
null
であってはなりません)IOExceptionSE
- InputStream のオープンに失敗した場合 requiresReader()
, getReader()
public int hashCode()
ObjectSE
の hashCodeSE
public StringSE toString()
ObjectSE
の toStringSE