Exception InvalidProtocolBufferException (3.19.4)

public class InvalidProtocolBufferException extends IOException

Thrown when a protocol message being parsed is invalid in some way, e.g. it contains a malformed varint or a negative byte length.

Constructors

InvalidProtocolBufferException(IOException e)

public InvalidProtocolBufferException(IOException e)
Parameter
NameDescription
eIOException

InvalidProtocolBufferException(String description)

public InvalidProtocolBufferException(String description)
Parameter
NameDescription
descriptionString

InvalidProtocolBufferException(String description, IOException e)

public InvalidProtocolBufferException(String description, IOException e)
Parameters
NameDescription
descriptionString
eIOException

Methods

getUnfinishedMessage()

public MessageLite getUnfinishedMessage()

Returns the unfinished message attached to the exception, or null if no message is attached.

Returns
TypeDescription
MessageLite

setUnfinishedMessage(MessageLite unfinishedMessage)

public InvalidProtocolBufferException setUnfinishedMessage(MessageLite unfinishedMessage)

Attaches an unfinished message to the exception to support best-effort parsing in Parser interface.

Parameter
NameDescription
unfinishedMessageMessageLite
Returns
TypeDescription
InvalidProtocolBufferException

this

unwrapIOException()

public IOException unwrapIOException()

Unwraps the underlying IOException if this exception was caused by an I/O problem. Otherwise, returns this.

Returns
TypeDescription
IOException