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
Name Description
e IOException

InvalidProtocolBufferException(String description)

public InvalidProtocolBufferException(String description)
Parameter
Name Description
description String

InvalidProtocolBufferException(String description, IOException e)

public InvalidProtocolBufferException(String description, IOException e)
Parameters
Name Description
description String
e IOException

Methods

getUnfinishedMessage()

public MessageLite getUnfinishedMessage()

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

Returns
Type Description
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
Name Description
unfinishedMessage MessageLite
Returns
Type Description
InvalidProtocolBufferException

this

unwrapIOException()

public IOException unwrapIOException()

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

Returns
Type Description
IOException