Class NetHttpResponse.SizeValidatingInputStream
- java.lang.Object
-
- java.io.InputStream
-
- java.io.FilterInputStream
-
- com.google.api.client.http.javanet.NetHttpResponse.SizeValidatingInputStream
-
- All Implemented Interfaces:
java.io.Closeable,java.lang.AutoCloseable
- Enclosing class:
- NetHttpResponse
private final class NetHttpResponse.SizeValidatingInputStream extends java.io.FilterInputStreamA wrapper arround the baseInputStreamthat validates EOF returned by the read calls.- Since:
- 1.20
-
-
Field Summary
Fields Modifier and Type Field Description private longbytesRead
-
Constructor Summary
Constructors Constructor Description SizeValidatingInputStream(java.io.InputStream in)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intread()intread(byte[] b, int off, int len)java.io.InputStream#read(byte[], int, int) swallows IOException thrown from read() so we have to override it.private voidthrowIfFalseEOF()
-
-
-
Method Detail
-
read
public int read(byte[] b, int off, int len) throws java.io.IOExceptionjava.io.InputStream#read(byte[], int, int) swallows IOException thrown from read() so we have to override it.- Overrides:
readin classjava.io.FilterInputStream- Throws:
java.io.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 java.io.IOException- Overrides:
readin classjava.io.FilterInputStream- Throws:
java.io.IOException
-
throwIfFalseEOF
private void throwIfFalseEOF() throws java.io.IOException- Throws:
java.io.IOException
-
-