CodedInputStream

Companion
object
class Object
trait Matchable
class Any

Value members

Constructors

def this(buffer: Array[Byte], offset: Int, len: Int)
def this(is: InputStream)

Concrete methods

def checkLastTagWas(value: Int): Unit
def enableAliasing(aliasing: Boolean): Unit
def getTotalBytesRead(): Int
def isAtEnd: Boolean

Returns true if the stream has reached the end of the input. This is the case if either the end of the underlying input source has been reached or if the stream has reached a limit created using [[#pushLimit(int)]].

Returns true if the stream has reached the end of the input. This is the case if either the end of the underlying input source has been reached or if the stream has reached a limit created using [[#pushLimit(int)]].

def popLimit(oldLimit: Int): Unit

Discards the current limit, returning to the previous limit.

Discards the current limit, returning to the previous limit.

Value Params
oldLimit

The old limit, as returned by { @code pushLimit}.

def pushLimit(byteLimit0: Int): Int

Sets currentLimit to (current position) + byteLimit. This is called when descending into a length-delimited embedded message.

Sets currentLimit to (current position) + byteLimit. This is called when descending into a length-delimited embedded message.

Note that pushLimit() does NOT affect how many bytes the CodedInputStream reads from an underlying InputStream when refreshing its buffer. If you need to prevent reading past a certain point in the underlying InputStream (e.g. because you expect it to contain more data after the end of the message which you need to handle differently) then you must place a wrapper around your InputStream which limits the amount of data that can be read from it.

Returns

the old limit.

def readBool(): Boolean

Read a bool field value from the stream.

Read a bool field value from the stream.

def readByteArray(): Array[Byte]
def readByteBuffer(): ByteBuffer
@throws(scala.throws.$lessinit$greater$default$1[com.google.protobuf.InvalidProtocolBufferException])

Read a bytes field value from the stream.

Read a bytes field value from the stream.

def readDouble(): Double

Read a double field value from the stream.

Read a double field value from the stream.

def readEnum(): Int

Read an enum field value from the stream. Caller is responsible for converting the numeric value to an actual enum.

Read an enum field value from the stream. Caller is responsible for converting the numeric value to an actual enum.

def readFixed32(): Int

Read a fixed32 field value from the stream.

Read a fixed32 field value from the stream.

def readFixed64(): Long

Read a fixed64 field value from the stream.

Read a fixed64 field value from the stream.

def readFloat(): Float

Read a float field value from the stream.

Read a float field value from the stream.

def readInt32(): Int

Read an int32 field value from the stream.

Read an int32 field value from the stream.

def readInt64(): Long

Read an int64 field value from the stream.

Read an int64 field value from the stream.

@throws(scala.throws.$lessinit$greater$default$1[com.google.protobuf.InvalidProtocolBufferException])
def readRawByte(): Byte

Read one byte from the input.

Read one byte from the input.

@throws(scala.throws.$lessinit$greater$default$1[com.google.protobuf.InvalidProtocolBufferException])
def readRawBytes(size: Int): Array[Byte]

Read a fixed size of bytes from the input.

Read a fixed size of bytes from the input.

Read a 32-bit little-endian integer from the stream.

Read a 32-bit little-endian integer from the stream.

Read a 64-bit little-endian integer from the stream.

Read a 64-bit little-endian integer from the stream.

@throws(scala.throws.$lessinit$greater$default$1[com.google.protobuf.InvalidProtocolBufferException])
def readRawVarint32(): Int

Read a raw Varint from the stream. If larger than 32 bits, discard the upper bits.

Read a raw Varint from the stream. If larger than 32 bits, discard the upper bits.

@throws(scala.throws.$lessinit$greater$default$1[com.google.protobuf.InvalidProtocolBufferException])
def readRawVarint64(): Long

Read a raw Varint from the stream.

Read a raw Varint from the stream.

def readSFixed32(): Int

Read an sfixed32 field value from the stream.

Read an sfixed32 field value from the stream.

def readSFixed64(): Long

Read an sfixed64 field value from the stream.

Read an sfixed64 field value from the stream.

def readSInt32(): Int

Read an sint32 field value from the stream.

Read an sint32 field value from the stream.

def readSInt64(): Long

Read an sint64 field value from the stream.

Read an sint64 field value from the stream.

def readString(): String
def readStringRequireUtf8(): String
@throws(scala.throws.$lessinit$greater$default$1[com.google.protobuf.InvalidProtocolBufferException])
def readTag(): Int

Attempt to read a field tag, returning zero if we have reached EOF. Protocol message parsers use this to read tags, since a protocol message may legally end wherever a tag occurs, and zero is not a valid tag number.

Attempt to read a field tag, returning zero if we have reached EOF. Protocol message parsers use this to read tags, since a protocol message may legally end wherever a tag occurs, and zero is not a valid tag number.

def readUInt32(): Int

Read a uint32 field value from the stream.

Read a uint32 field value from the stream.

def readUInt64(): Long

Read a uint64 field value from the stream.

Read a uint64 field value from the stream.

def resetSizeCounter(): Unit
def setSizeLimit(limit: Int): Int
@throws(scala.Predef.classOf[java.io.IOException])
def skipField(tag: Int): Boolean

Reads and discards a single field, given its tag value.

Reads and discards a single field, given its tag value.

Returns

{ @code false} if the tag is an endgroup tag, in which case nothing is skipped. Otherwise, returns { @code true}.

def skipMessage(): Unit

Reads and discards an entire message. This will read either until EOF or until an endgroup tag, whichever comes first.

Reads and discards an entire message. This will read either until EOF or until an endgroup tag, whichever comes first.

def skipRawBytes(size: Int): Unit

Reads and discards size bytes.

Reads and discards size bytes.