public class InputStreamResource extends AbstractResource<InputStream>
| 构造器和说明 |
|---|
InputStreamResource(InputStream inputStream)
Create a new InputStreamResource.
|
InputStreamResource(InputStream inputStream,
String description)
Create a new InputStreamResource.
|
| 限定符和类型 | 方法和说明 |
|---|---|
long |
contentLength()
Determine the content length for this resource.
|
boolean |
equals(Object other)
This implementation compares the underlying InputStream.
|
boolean |
exists()
This implementation always returns
true. |
InputStream |
getInputStream()
This implementation throws IllegalStateException if attempting to
read the underlying stream multiple times.
|
InputStream |
getRealResource() |
int |
hashCode()
This implementation returns the hash code of the underlying InputStream.
|
String |
toString()
This implementation returns a description that includes the passed-in
description, if any.
|
isReadable, readableChannelpublic InputStreamResource(InputStream inputStream)
inputStream - the InputStream to usepublic InputStreamResource(InputStream inputStream, @Nullable String description)
inputStream - the InputStream to usedescription - where the InputStream comes frompublic InputStream getRealResource()
public boolean exists()
true.exists 在接口中 Resource<InputStream>exists 在类中 AbstractResource<InputStream>public long contentLength()
Resourcepublic InputStream getInputStream() throws IOException, IllegalStateException
null)FileNotFoundException - if the underlying resource doesn't existIOException - if the content stream could not be openedIllegalStateExceptionpublic String toString()
public boolean equals(Object other)
Copyright © 2020. All rights reserved.