org.codehaus.httpcache4j.payload
Class InputStreamPayload

java.lang.Object
  extended by org.codehaus.httpcache4j.payload.InputStreamPayload
All Implemented Interfaces:
Payload

public class InputStreamPayload
extends java.lang.Object
implements Payload


Constructor Summary
InputStreamPayload(java.io.InputStream stream, MIMEType mimeType)
           
 
Method Summary
 java.io.InputStream getInputStream()
          Returns the input stream of the payload.
 MIMEType getMimeType()
          Return the mime-type of the payload.
 boolean isAvailable()
          Returns true if the payload is available, IE.
 boolean isTransient()
          Returns the transientness of the payload.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

InputStreamPayload

public InputStreamPayload(java.io.InputStream stream,
                          MIMEType mimeType)
Method Detail

getMimeType

public MIMEType getMimeType()
Description copied from interface: Payload
Return the mime-type of the payload.

Specified by:
getMimeType in interface Payload
Returns:
the mime-type

isAvailable

public boolean isAvailable()
Description copied from interface: Payload
Returns true if the payload is available, IE. If the stream can be read from.

Specified by:
isAvailable in interface Payload
Returns:
true if the payload is available. false if not.

isTransient

public boolean isTransient()
Description copied from interface: Payload
Returns the transientness of the payload. I.E if the payload can be re-read.

Specified by:
isTransient in interface Payload
Returns:
true if the payload can be re-read. false if not.

getInputStream

public java.io.InputStream getInputStream()
Description copied from interface: Payload
Returns the input stream of the payload. This stream MUST be closed when you are done with it.

Specified by:
getInputStream in interface Payload
Returns:
the inputstream of the payload, may return null if the payload is not available.


Copyright © 2008. All Rights Reserved.