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.FilterInputStream
A wrapper arround the baseInputStream
that validates EOF returned by the read calls.- Since:
- 1.20
-
-
Field Summary
Fields Modifier and Type Field Description private long
bytesRead
-
Constructor Summary
Constructors Constructor Description SizeValidatingInputStream(java.io.InputStream in)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
read()
int
read(byte[] b, int off, int len)
java.io.InputStream#read(byte[], int, int) swallows IOException thrown from read() so we have to override it.long
skip(long len)
private void
throwIfFalseEOF()
-
-
-
Method Detail
-
read
public int read(byte[] b, int off, int len) throws java.io.IOException
java.io.InputStream#read(byte[], int, int) swallows IOException thrown from read() so we have to override it.- Overrides:
read
in 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:
read
in classjava.io.FilterInputStream
- Throws:
java.io.IOException
-
skip
public long skip(long len) throws java.io.IOException
- Overrides:
skip
in classjava.io.FilterInputStream
- Throws:
java.io.IOException
-
throwIfFalseEOF
private void throwIfFalseEOF() throws java.io.IOException
- Throws:
java.io.IOException
-
-