Class LimitedInputStream

java.lang.Object
java.io.InputStream
org.apache.xmlrpc.util.LimitedInputStream
All Implemented Interfaces:
Closeable, AutoCloseable

public class LimitedInputStream extends InputStream
A filtering InputStream for proper handling of the Content-Length header: It guarantees to return at most a given number of bytes.
  • Field Details

    • available

      private long available
    • markedAvailable

      private long markedAvailable
    • in

      private InputStream in
  • 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