Top Description Inners Fields Constructors Methods
com.google.protobuf

public Class InvalidProtocolBufferException

extends IOException
Class Inheritance
Known Direct Subclasses
com.google.protobuf.InvalidProtocolBufferException.InvalidWireTypeException
Imports
java.io.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.
Author
[email protected] Kenton Varda

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static class
InvalidProtocolBufferException.InvalidWireTypeException

Exception indicating that and unexpected wire type was encountered for a field.

Field Summary

Modifier and TypeField and Description
private static final long
private MessageLite

Constructor Summary

AccessConstructor and Description
public
public
public

Method Summary

Modifier and TypeMethod and Description
public MessageLite
getUnfinishedMessage()

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

pack-priv static InvalidProtocolBufferException
pack-priv static InvalidProtocolBufferException
pack-priv static InvalidProtocolBufferException
pack-priv static InvalidProtocolBufferException.InvalidWireTypeException
pack-priv static InvalidProtocolBufferException
pack-priv static InvalidProtocolBufferException
pack-priv static InvalidProtocolBufferException
pack-priv static InvalidProtocolBufferException
public InvalidProtocolBufferException

Returns:

this
setUnfinishedMessage
(MessageLite unfinishedMessage)

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

pack-priv static InvalidProtocolBufferException
pack-priv static InvalidProtocolBufferException
public IOException
unwrapIOException()

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

Field Detail

serialVersionUIDback to summary
private static final long serialVersionUID

Hides java.io.IOException.serialVersionUID.

unfinishedMessageback to summary
private MessageLite unfinishedMessage

Constructor Detail

InvalidProtocolBufferExceptionback to summary
public InvalidProtocolBufferException(final String description)
InvalidProtocolBufferExceptionback to summary
public InvalidProtocolBufferException(IOException e)
InvalidProtocolBufferExceptionback to summary
public InvalidProtocolBufferException(final String description, IOException e)

Method Detail

getUnfinishedMessageback to summary
public MessageLite getUnfinishedMessage()

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

invalidEndTagback to summary
pack-priv static InvalidProtocolBufferException invalidEndTag()
invalidTagback to summary
pack-priv static InvalidProtocolBufferException invalidTag()
invalidUtf8back to summary
pack-priv static InvalidProtocolBufferException invalidUtf8()
invalidWireTypeback to summary
pack-priv static InvalidProtocolBufferException.InvalidWireTypeException invalidWireType()
malformedVarintback to summary
pack-priv static InvalidProtocolBufferException malformedVarint()
negativeSizeback to summary
pack-priv static InvalidProtocolBufferException negativeSize()
parseFailureback to summary
pack-priv static InvalidProtocolBufferException parseFailure()
recursionLimitExceededback to summary
pack-priv static InvalidProtocolBufferException recursionLimitExceeded()
setUnfinishedMessageback to summary
public InvalidProtocolBufferException setUnfinishedMessage(MessageLite unfinishedMessage)

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

Returns:InvalidProtocolBufferException

this

sizeLimitExceededback to summary
pack-priv static InvalidProtocolBufferException sizeLimitExceeded()
truncatedMessageback to summary
pack-priv static InvalidProtocolBufferException truncatedMessage()
unwrapIOExceptionback to summary
public IOException unwrapIOException()

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

com.google.protobuf back to summary

public Class InvalidProtocolBufferException.InvalidWireTypeException

extends InvalidProtocolBufferException
Class Inheritance
Annotations
@ExperimentalApi

Exception indicating that and unexpected wire type was encountered for a field.

Field Summary

Modifier and TypeField and Description
private static final long

Constructor Summary

AccessConstructor and Description
public

Method Summary

Inherited from com.google.protobuf.InvalidProtocolBufferException:
getUnfinishedMessageinvalidEndTaginvalidTaginvalidUtf8invalidWireTypemalformedVarintnegativeSizeparseFailurerecursionLimitExceededsetUnfinishedMessagesizeLimitExceededtruncatedMessageunwrapIOException

Field Detail

serialVersionUIDback to summary
private static final long serialVersionUID

Hides com.google.protobuf.InvalidProtocolBufferException.serialVersionUID.

Constructor Detail

InvalidWireTypeExceptionback to summary
public InvalidWireTypeException(String description)