public class InputStreamResource extends AbstractResource<InputStream> implements Locatable
| 构造器和说明 |
|---|
InputStreamResource(InputStream inputStream)
Create a new InputStreamResource.
|
InputStreamResource(InputStream inputStream,
String path)
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. |
String |
getAbsolutePath() |
String |
getDescription() |
InputStream |
getInputStream()
This implementation throws IllegalStateException if attempting to
read the underlying stream multiple times.
|
Location |
getLocation() |
String |
getPath() |
String |
getPrefix() |
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 path)
inputStream - the InputStream to usepath - where the InputStream comes frompublic InputStream getRealResource()
getRealResource 在接口中 Resource<InputStream>public String getDescription()
public Location getLocation()
getLocation 在接口中 Locatablepublic String getAbsolutePath()
getAbsolutePath 在接口中 Locatablepublic boolean exists()
true.exists 在接口中 Resource<InputStream>exists 在类中 AbstractResource<InputStream>public long contentLength()
ResourcecontentLength 在接口中 Resource<InputStream>public InputStream getInputStream() throws IOException, IllegalStateException
getInputStream 在接口中 Resource<InputStream>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 © 2022. All rights reserved.