public class LimitedInputStream
extends java.io.InputStream
InputStream for proper handling of
the Content-Length header: It guarantees to return
at most a given number of bytes.| Constructor and Description |
|---|
LimitedInputStream(java.io.InputStream pIn,
int pAvailable)
Creates a new instance, reading from the given input stream
and returning at most the given number of bytes.
|
public LimitedInputStream(java.io.InputStream pIn,
int pAvailable)
pIn - Input stream being read.pAvailable - Number of bytes available in pIn.public int read()
throws java.io.IOException
read in class java.io.InputStreamjava.io.IOExceptionpublic int read(byte[] b,
int off,
int len)
throws java.io.IOException
read in class java.io.InputStreamjava.io.IOExceptionpublic long skip(long n)
throws java.io.IOException
skip in class java.io.InputStreamjava.io.IOExceptionpublic void mark(int readlimit)
mark in class java.io.InputStreampublic void reset()
throws java.io.IOException
reset in class java.io.InputStreamjava.io.IOExceptionpublic boolean markSupported()
markSupported in class java.io.InputStreamCopyright © 2001-2013. All Rights Reserved.