Class EntityServletInputStream
- java.lang.Object
-
- java.io.InputStream
-
- javax.servlet.ServletInputStream
-
- org.sakaiproject.entitybroker.util.http.EntityServletInputStream
-
- All Implemented Interfaces:
Closeable,AutoCloseable
public class EntityServletInputStream extends ServletInputStream
This is a class which allows us to produce and controlServletInputStreams, normally there is no default implementation available for these for some stupid reason- Author:
- Aaron Zeckoski (azeckoski @ gmail.com)
-
-
Constructor Summary
Constructors Constructor Description EntityServletInputStream(InputStream inputStream)Creates the SIS from an existing inputstreamEntityServletInputStream(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 memoryEntityServletInputStream(String str)Creates the SIS from an existing string
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intavailable()voidclose()booleanequals(Object obj)inthashCode()voidmark(int readlimit)booleanmarkSupported()intread()intread(byte[] b)intread(byte[] b, int off, int len)voidreset()longskip(long n)StringtoString()-
Methods inherited from class javax.servlet.ServletInputStream
readLine
-
Methods inherited from class java.io.InputStream
nullInputStream, readAllBytes, readNBytes, readNBytes, transferTo
-
-
-
-
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:
readin classInputStream- Throws:
IOException
-
available
public int available() throws IOException- Overrides:
availablein classInputStream- Throws:
IOException
-
close
public void close() throws IOException- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Overrides:
closein classInputStream- Throws:
IOException
-
mark
public void mark(int readlimit)
- Overrides:
markin classInputStream
-
markSupported
public boolean markSupported()
- Overrides:
markSupportedin classInputStream
-
read
public int read(byte[] b, int off, int len) throws IOException- Overrides:
readin classInputStream- Throws:
IOException
-
read
public int read(byte[] b) throws IOException- Overrides:
readin classInputStream- Throws:
IOException
-
reset
public void reset() throws IOException- Overrides:
resetin classInputStream- Throws:
IOException
-
skip
public long skip(long n) throws IOException- Overrides:
skipin classInputStream- Throws:
IOException
-
-