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.InputStream
java.io.IOException
public int read(byte[] b, int off, int len) throws java.io.IOException
read
in class java.io.InputStream
java.io.IOException
public long skip(long n) throws java.io.IOException
skip
in class java.io.InputStream
java.io.IOException
public void mark(int readlimit)
mark
in class java.io.InputStream
public void reset() throws java.io.IOException
reset
in class java.io.InputStream
java.io.IOException
public boolean markSupported()
markSupported
in class java.io.InputStream
Copyright © 2001-2013. All Rights Reserved.