org.apache.xmlrpc.util

Class LimitedInputStream


public class LimitedInputStream
extends InputStream

A filtering java.io.InputStream for proper handling of the Content-Length header: It guarantees to return at most a given number of bytes.

Constructor Summary

LimitedInputStream(InputStream pIn, int pAvailable)
Creates a new instance, reading from the given input stream and returning at most the given number of bytes.

Method Summary

void
mark(int readlimit)
boolean
markSupported()
int
read()
int
read(b[] , int off, int len)
void
reset()
long
skip(long n)

Constructor Details

LimitedInputStream

public LimitedInputStream(InputStream pIn,
                          int pAvailable)
Creates a new instance, reading from the given input stream and returning at most the given number of bytes.
Parameters:
pIn - Input stream being read.
pAvailable - Number of bytes available in pIn.

Method Details

mark

public void mark(int readlimit)

markSupported

public boolean markSupported()

read

public int read()
            throws IOException

read

public int read(b[] ,
                int off,
                int len)
            throws IOException

reset

public void reset()
            throws IOException

skip

public long skip(long n)
            throws IOException

Copyright © 2001-2007 Apache Software Foundation. All Rights Reserved.