public class InputStreamResource extends AbstractResource
InputStream
SE の Resource
実装。 他の特定の Resource
実装が適用できない場合にのみ使用してください。特に、可能な場合は ByteArrayResource
またはファイルベースの Resource
実装を優先してください。
他の Resource
実装とは対照的に、これはすでに開かれているリソースの記述子です。isOpen()
から true
を返します。リソース記述子をどこかに保持する必要がある場合、またはストリームから複数回読み取る必要がある場合は、InputStreamResource
を使用しないでください。
ByteArrayResource
, ClassPathResource
, FileSystemResource
, UrlResource
コンストラクターと説明 |
---|
InputStreamResource(InputStreamSE inputStream) 新しい InputStreamResource を作成します。 |
InputStreamResource(InputStreamSE inputStream, StringSE description) 新しい InputStreamResource を作成します。 |
修飾子と型 | メソッドと説明 |
---|---|
boolean | equals(ObjectSE other) この実装は、基礎となる InputStream を比較します。 |
boolean | exists() この実装は、常に true を返します。 |
StringSE | getDescription() この実装は、もしあれば、渡された説明を含む説明を返します。 |
InputStreamSE | getInputStream() 基になるストリームを複数回読み取ろうとすると、この実装は IllegalStateException をスローします。 |
int | hashCode() この実装は、基になる InputStream のハッシュコードを返します。 |
boolean | isOpen() この実装は、常に true を返します。 |
contentLength, createRelative, getFile, getFileForLastModifiedCheck, getFilename, getURI, getURL, isFile, isReadable, lastModified, readableChannel, toString
cloneSE, finalizeSE, getClassSE, notifySE, notifyAllSE, waitSE, waitSE, waitSE
public InputStreamResource(InputStreamSE inputStream)
inputStream
- 使用する InputStreampublic InputStreamResource(InputStreamSE inputStream, @Nullable StringSE description)
inputStream
- 使用する InputStreamdescription
- InputStream の由来 public boolean exists()
true
を返します。Resource
の exists
AbstractResource
の exists
public boolean isOpen()
true
を返します。Resource
の isOpen
AbstractResource
の isOpen
public InputStreamSE getInputStream() throws IOExceptionSE, IllegalStateExceptionSE
null
であってはなりません)FileNotFoundExceptionSE
- 基になるリソースが存在しない場合 IOExceptionSE
- コンテンツストリームを開けなかった場合 IllegalStateExceptionSE
public StringSE getDescription()
Object.toString()
SEpublic boolean equals(ObjectSE other)
AbstractResource
の equals
Resource.getDescription()
public int hashCode()
AbstractResource
の hashCode
Resource.getDescription()