org.sakaiproject.entitybroker.util.http
Class EntityServletInputStream

java.lang.Object
  extended by java.io.InputStream
      extended by javax.servlet.ServletInputStream
          extended by org.sakaiproject.entitybroker.util.http.EntityServletInputStream
All Implemented Interfaces:
Closeable

public class EntityServletInputStream
extends javax.servlet.ServletInputStream

This is a class which allows us to produce and control ServletInputStreams, normally there is no default implementation available for these for some stupid reason

Author:
Aaron Zeckoski (azeckoski @ gmail.com)

Constructor Summary
EntityServletInputStream(InputStream inputStream)
          Creates the SIS from an existing inputstream
EntityServletInputStream(Reader reader)
          Creates the SIS from any existing reader, note that this is not very efficient as it has to load the full reader into memory
EntityServletInputStream(String str)
          Creates the SIS from an existing string
 
Method Summary
 int available()
           
 void close()
           
 boolean equals(Object obj)
           
 int hashCode()
           
 void mark(int readlimit)
           
 boolean markSupported()
           
 int read()
           
 int read(byte[] b)
           
 int read(byte[] b, int off, int len)
           
 void reset()
           
 long skip(long n)
           
 String toString()
           
 
Methods inherited from class javax.servlet.ServletInputStream
readLine
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

EntityServletInputStream

public EntityServletInputStream(InputStream inputStream)
Creates the SIS from an existing inputstream

Parameters:
inputStream - the IS to create the SIS from, can be buffered or not

EntityServletInputStream

public EntityServletInputStream(String str)
Creates the SIS from an existing string

Parameters:
str - any string

EntityServletInputStream

public EntityServletInputStream(Reader reader)
Creates the SIS from any existing reader, note that this is not very efficient as it has to load the full reader into memory

Parameters:
reader - any reader object, buffered or not
Method Detail

read

public int read()
         throws IOException
Specified by:
read in class InputStream
Throws:
IOException

available

public int available()
              throws IOException
Overrides:
available in class InputStream
Throws:
IOException

close

public void close()
           throws IOException
Specified by:
close in interface Closeable
Overrides:
close in class InputStream
Throws:
IOException

equals

public boolean equals(Object obj)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

mark

public void mark(int readlimit)
Overrides:
mark in class InputStream

markSupported

public boolean markSupported()
Overrides:
markSupported in class InputStream

read

public int read(byte[] b,
                int off,
                int len)
         throws IOException
Overrides:
read in class InputStream
Throws:
IOException

read

public int read(byte[] b)
         throws IOException
Overrides:
read in class InputStream
Throws:
IOException

reset

public void reset()
           throws IOException
Overrides:
reset in class InputStream
Throws:
IOException

skip

public long skip(long n)
          throws IOException
Overrides:
skip in class InputStream
Throws:
IOException

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2007-2013 CARET, University of Cambridge. All Rights Reserved.