Package io.grpc.protobuf.lite
Class ProtoInputStream
- java.lang.Object
-
- java.io.InputStream
-
- io.grpc.protobuf.lite.ProtoInputStream
-
- All Implemented Interfaces:
Drainable
,KnownLength
,java.io.Closeable
,java.lang.AutoCloseable
final class ProtoInputStream extends java.io.InputStream implements Drainable, KnownLength
AnInputStream
backed by a protobuf.
-
-
Constructor Summary
Constructors Constructor Description ProtoInputStream(com.google.protobuf.MessageLite message, com.google.protobuf.Parser<?> parser)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
available()
Returns the total number of bytes that can be read (or skipped over) from this object until all bytes have been read out.int
drainTo(java.io.OutputStream target)
Transfers the entire contents of this stream to the specified target.(package private) com.google.protobuf.MessageLite
message()
(package private) com.google.protobuf.Parser<?>
parser()
int
read()
int
read(byte[] b, int off, int len)
-
-
-
Method Detail
-
drainTo
public int drainTo(java.io.OutputStream target) throws java.io.IOException
Description copied from interface:Drainable
Transfers the entire contents of this stream to the specified target.
-
read
public int read()
- Specified by:
read
in classjava.io.InputStream
-
read
public int read(byte[] b, int off, int len) throws java.io.IOException
- Overrides:
read
in classjava.io.InputStream
- Throws:
java.io.IOException
-
available
public int available()
Description copied from interface:KnownLength
Returns the total number of bytes that can be read (or skipped over) from this object until all bytes have been read out.- Specified by:
available
in interfaceKnownLength
- Overrides:
available
in classjava.io.InputStream
-
message
com.google.protobuf.MessageLite message()
-
parser
com.google.protobuf.Parser<?> parser()
-
-