Class ProtoInputStream
java.lang.Object
java.io.InputStream
io.grpc.protobuf.lite.ProtoInputStream
- All Implemented Interfaces:
Drainable, KnownLength, Closeable, AutoCloseable
An
InputStream backed by a protobuf.-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate com.google.protobuf.MessageLiteprivate final com.google.protobuf.Parser<?> private ByteArrayInputStream -
Constructor Summary
ConstructorsConstructorDescriptionProtoInputStream(com.google.protobuf.MessageLite message, com.google.protobuf.Parser<?> parser) -
Method Summary
Modifier and TypeMethodDescriptionintReturns the total number of bytes that can be read (or skipped over) from this object until all bytes have been read out.intdrainTo(OutputStream target) Transfers the entire contents of this stream to the specified target.(package private) com.google.protobuf.MessageLitemessage()(package private) com.google.protobuf.Parser<?> parser()intread()intread(byte[] b, int off, int len) Methods inherited from class InputStream
close, mark, markSupported, read, reset, skip
-
Field Details
-
message
-
parser
private final com.google.protobuf.Parser<?> parser -
partial
-
-
Constructor Details
-
ProtoInputStream
ProtoInputStream(com.google.protobuf.MessageLite message, com.google.protobuf.Parser<?> parser)
-
-
Method Details
-
drainTo
Description copied from interface:DrainableTransfers the entire contents of this stream to the specified target.- Specified by:
drainToin interfaceDrainable- Parameters:
target- to write to.- Returns:
- number of bytes written.
- Throws:
IOException
-
read
public int read()- Specified by:
readin classInputStream
-
read
- Overrides:
readin classInputStream- Throws:
IOException
-
available
public int available()Description copied from interface:KnownLengthReturns the total number of bytes that can be read (or skipped over) from this object until all bytes have been read out.- Specified by:
availablein interfaceKnownLength- Overrides:
availablein classInputStream
-
message
com.google.protobuf.MessageLite message() -
parser
com.google.protobuf.Parser<?> parser()
-