org.springframework.extensions.surf.util
Class InputStreamContent

java.lang.Object
  extended by org.springframework.extensions.surf.util.InputStreamContent
All Implemented Interfaces:
Serializable, Content

public class InputStreamContent
extends Object
implements Content, Serializable

Input Stream based Content

See Also:
Serialized Form

Constructor Summary
InputStreamContent(InputStream stream, String mimetype, String encoding)
          Constructor
 
Method Summary
 String getContent()
          Gets content as a string
 String getEncoding()
          Gets the content encoding
 InputStream getInputStream()
          Gets the content input stream
 String getMimetype()
          Gets the content mimetype
 Reader getReader()
          Gets the content reader (which is sensitive to encoding)
 long getSize()
          Gets the content length (in bytes)
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

InputStreamContent

public InputStreamContent(InputStream stream,
                          String mimetype,
                          String encoding)
Constructor

Parameters:
stream - content input stream
mimetype - content mimetype
Method Detail

getContent

public String getContent()
                  throws IOException
Description copied from interface: Content
Gets content as a string

Specified by:
getContent in interface Content
Returns:
content as a string
Throws:
IOException

getInputStream

public InputStream getInputStream()
Description copied from interface: Content
Gets the content input stream

Specified by:
getInputStream in interface Content
Returns:
input stream

getReader

public Reader getReader()
                 throws IOException
Description copied from interface: Content
Gets the content reader (which is sensitive to encoding)

Specified by:
getReader in interface Content
Returns:
Throws:
IOException

getSize

public long getSize()
Description copied from interface: Content
Gets the content length (in bytes)

Specified by:
getSize in interface Content
Returns:
length

getMimetype

public String getMimetype()
Description copied from interface: Content
Gets the content mimetype

Specified by:
getMimetype in interface Content
Returns:
mimetype

getEncoding

public String getEncoding()
Description copied from interface: Content
Gets the content encoding

Specified by:
getEncoding in interface Content
Returns:
encoding


Copyright © 2009 SpringSource, Inc. All Rights Reserved.