Class NetHttpResponse.SizeValidatingInputStream

java.lang.Object
java.io.InputStream
java.io.FilterInputStream
com.google.api.client.http.javanet.NetHttpResponse.SizeValidatingInputStream
All Implemented Interfaces:
Closeable, AutoCloseable
Enclosing class:
NetHttpResponse

private final class NetHttpResponse.SizeValidatingInputStream extends FilterInputStream
A wrapper arround the base InputStream that validates EOF returned by the read calls.
Since:
1.20
  • Field Details

    • bytesRead

      private long bytesRead
  • Constructor Details

    • SizeValidatingInputStream

      public SizeValidatingInputStream(InputStream in)
  • Method Details

    • read

      public int read(byte[] b, int off, int len) throws IOException
      java.io.InputStream#read(byte[], int, int) swallows IOException thrown from read() so we have to override it.
      Overrides:
      read in class FilterInputStream
      Throws:
      IOException
      See Also:
      • "http://grepcode.com/file/repository.grepcode.com/java/root/jdk/openjdk/8-b132/java/io/InputStream.java#185"
    • read

      public int read() throws IOException
      Overrides:
      read in class FilterInputStream
      Throws:
      IOException
    • throwIfFalseEOF

      private void throwIfFalseEOF() throws IOException
      Throws:
      IOException