Package com.google.protobuf
Class InvalidProtocolBufferException
java.lang.Object
java.lang.Throwable
java.lang.Exception
java.io.IOException
com.google.protobuf.InvalidProtocolBufferException
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
InvalidProtocolBufferException.InvalidWireTypeException
Thrown when a protocol message being parsed is invalid in some way, e.g. it contains a malformed
varint or a negative byte length.
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
Exception indicating that an unexpected wire type was encountered for a field. -
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionInvalidProtocolBufferException
(String description) InvalidProtocolBufferException
(String description, IOException e) -
Method Summary
Modifier and TypeMethodDescription(package private) boolean
Allows code catching IOException from CodedInputStream to tell whether this instance was thrown by a delegate InputStream, rather than directly by a parse failure.Returns the unfinished message attached to the exception, or null if no message is attached.(package private) static InvalidProtocolBufferException
(package private) static InvalidProtocolBufferException
(package private) static InvalidProtocolBufferException
(package private) static InvalidProtocolBufferException.InvalidWireTypeException
(package private) static InvalidProtocolBufferException
(package private) static InvalidProtocolBufferException
(package private) static InvalidProtocolBufferException
(package private) static InvalidProtocolBufferException
(package private) void
Set by CodedInputStreamsetUnfinishedMessage
(MessageLite unfinishedMessage) Attaches an unfinished message to the exception to support best-effort parsing inParser
interface.(package private) static InvalidProtocolBufferException
(package private) static InvalidProtocolBufferException
Unwraps the underlyingIOException
if this exception was caused by an I/O problem.Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Field Details
-
serialVersionUID
private static final long serialVersionUID- See Also:
-
unfinishedMessage
-
wasThrownFromInputStream
private boolean wasThrownFromInputStream
-
-
Constructor Details
-
InvalidProtocolBufferException
-
InvalidProtocolBufferException
-
InvalidProtocolBufferException
-
-
Method Details
-
setUnfinishedMessage
Attaches an unfinished message to the exception to support best-effort parsing inParser
interface.- Returns:
- this
-
getUnfinishedMessage
Returns the unfinished message attached to the exception, or null if no message is attached. -
setThrownFromInputStream
void setThrownFromInputStream()Set by CodedInputStream -
getThrownFromInputStream
boolean getThrownFromInputStream()Allows code catching IOException from CodedInputStream to tell whether this instance was thrown by a delegate InputStream, rather than directly by a parse failure. -
unwrapIOException
Unwraps the underlyingIOException
if this exception was caused by an I/O problem. Otherwise, returnsthis
. -
truncatedMessage
-
negativeSize
-
malformedVarint
-
invalidTag
-
invalidEndTag
-
invalidWireType
-
recursionLimitExceeded
-
sizeLimitExceeded
-
parseFailure
-
invalidUtf8
-