| 
Spring for Android | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.springframework.core.io.AbstractResource
org.springframework.core.io.InputStreamResource
public class InputStreamResource
Resource implementation for a given InputStream. Should only
 be used if no specific Resource implementation is applicable.
 In particular, prefer ByteArrayResource or any of the
 file-based Resource implementations where possible.
 
In contrast to other Resource implementations, this is a descriptor
 for an already opened resource - therefore returning "true" from
 isOpen(). Do not use it if you need to keep the resource
 descriptor somewhere, or if you need to read a stream multiple times.
ByteArrayResource, 
ClassPathResource, 
FileSystemResource, 
UrlResource| Constructor Summary | |
|---|---|
InputStreamResource(java.io.InputStream inputStream)
Create a new InputStreamResource.  | 
|
InputStreamResource(java.io.InputStream inputStream,
                    java.lang.String description)
Create a new InputStreamResource.  | 
|
| Method Summary | |
|---|---|
 boolean | 
equals(java.lang.Object obj)
This implementation compares the underlying InputStream.  | 
 boolean | 
exists()
This implementation always returns true. | 
 java.lang.String | 
getDescription()
This implementation returns the passed-in description, if any.  | 
 java.io.InputStream | 
getInputStream()
This implementation throws IllegalStateException if attempting to read the underlying stream multiple times.  | 
 int | 
hashCode()
This implementation returns the hash code of the underlying InputStream.  | 
 boolean | 
isOpen()
This implementation always returns true. | 
| Methods inherited from class org.springframework.core.io.AbstractResource | 
|---|
contentLength, createRelative, getFile, getFileForLastModifiedCheck, getFilename, getURI, getURL, isReadable, lastModified, toString | 
| Methods inherited from class java.lang.Object | 
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait | 
| Constructor Detail | 
|---|
public InputStreamResource(java.io.InputStream inputStream)
inputStream - the InputStream to use
public InputStreamResource(java.io.InputStream inputStream,
                           java.lang.String description)
inputStream - the InputStream to usedescription - where the InputStream comes from| Method Detail | 
|---|
public boolean exists()
true.
exists in interface Resourceexists in class AbstractResourcepublic boolean isOpen()
true.
isOpen in interface ResourceisOpen in class AbstractResource
public java.io.InputStream getInputStream()
                                   throws java.io.IOException,
                                          java.lang.IllegalStateException
java.io.IOException - if the stream could not be opened
java.lang.IllegalStateExceptionpublic java.lang.String getDescription()
Object.toString()public boolean equals(java.lang.Object obj)
equals in class AbstractResourceResource.getDescription()public int hashCode()
hashCode in class AbstractResourceResource.getDescription()
  | 
Spring for Android | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||