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:
java.io.Serializable
- Direct Known Subclasses:
InvalidProtocolBufferException.InvalidWireTypeException
public class InvalidProtocolBufferException extends 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.- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
InvalidProtocolBufferException.InvalidWireTypeException
Exception indicating that and unexpected wire type was encountered for a field.
-
Field Summary
Fields Modifier and Type Field Description private static long
serialVersionUID
private MessageLite
unfinishedMessage
-
Constructor Summary
Constructors Constructor Description InvalidProtocolBufferException(java.io.IOException e)
InvalidProtocolBufferException(java.lang.String description)
InvalidProtocolBufferException(java.lang.String description, java.io.IOException e)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description MessageLite
getUnfinishedMessage()
Returns the unfinished message attached to the exception, or null if no message is attached.(package private) static InvalidProtocolBufferException
invalidEndTag()
(package private) static InvalidProtocolBufferException
invalidTag()
(package private) static InvalidProtocolBufferException
invalidUtf8()
(package private) static InvalidProtocolBufferException.InvalidWireTypeException
invalidWireType()
(package private) static InvalidProtocolBufferException
malformedVarint()
(package private) static InvalidProtocolBufferException
negativeSize()
(package private) static InvalidProtocolBufferException
parseFailure()
(package private) static InvalidProtocolBufferException
recursionLimitExceeded()
InvalidProtocolBufferException
setUnfinishedMessage(MessageLite unfinishedMessage)
Attaches an unfinished message to the exception to support best-effort parsing inParser
interface.(package private) static InvalidProtocolBufferException
sizeLimitExceeded()
(package private) static InvalidProtocolBufferException
truncatedMessage()
java.io.IOException
unwrapIOException()
Unwraps the underlyingIOException
if this exception was caused by an I/O problem.
-
-
-
Field Detail
-
serialVersionUID
private static final long serialVersionUID
- See Also:
- Constant Field Values
-
unfinishedMessage
private MessageLite unfinishedMessage
-
-
Constructor Detail
-
InvalidProtocolBufferException
public InvalidProtocolBufferException(java.lang.String description)
-
InvalidProtocolBufferException
public InvalidProtocolBufferException(java.io.IOException e)
-
InvalidProtocolBufferException
public InvalidProtocolBufferException(java.lang.String description, java.io.IOException e)
-
-
Method Detail
-
setUnfinishedMessage
public InvalidProtocolBufferException setUnfinishedMessage(MessageLite unfinishedMessage)
Attaches an unfinished message to the exception to support best-effort parsing inParser
interface.- Returns:
- this
-
getUnfinishedMessage
public MessageLite getUnfinishedMessage()
Returns the unfinished message attached to the exception, or null if no message is attached.
-
unwrapIOException
public java.io.IOException unwrapIOException()
Unwraps the underlyingIOException
if this exception was caused by an I/O problem. Otherwise, returnsthis
.
-
truncatedMessage
static InvalidProtocolBufferException truncatedMessage()
-
negativeSize
static InvalidProtocolBufferException negativeSize()
-
malformedVarint
static InvalidProtocolBufferException malformedVarint()
-
invalidTag
static InvalidProtocolBufferException invalidTag()
-
invalidEndTag
static InvalidProtocolBufferException invalidEndTag()
-
invalidWireType
static InvalidProtocolBufferException.InvalidWireTypeException invalidWireType()
-
recursionLimitExceeded
static InvalidProtocolBufferException recursionLimitExceeded()
-
sizeLimitExceeded
static InvalidProtocolBufferException sizeLimitExceeded()
-
parseFailure
static InvalidProtocolBufferException parseFailure()
-
invalidUtf8
static InvalidProtocolBufferException invalidUtf8()
-
-