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. For instance, 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 an unexpected wire type was encountered for a field.
-
Constructor Summary
Constructors Constructor Description InvalidProtocolBufferException(java.io.IOException e)
InvalidProtocolBufferException(java.lang.Exception e)
InvalidProtocolBufferException(java.lang.String description)
InvalidProtocolBufferException(java.lang.String description, java.io.IOException e)
InvalidProtocolBufferException(java.lang.String description, java.lang.Exception e)
-
Method Summary
All 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.InvalidProtocolBufferException
setUnfinishedMessage(MessageLite unfinishedMessage)
Attaches an unfinished message to the exception to support best-effort parsing inParser
interface.java.io.IOException
unwrapIOException()
Unwraps the underlyingIOException
if this exception was caused by an I/O problem.
-
-
-
Constructor Detail
-
InvalidProtocolBufferException
public InvalidProtocolBufferException(java.lang.String description)
-
InvalidProtocolBufferException
public InvalidProtocolBufferException(java.lang.Exception e)
-
InvalidProtocolBufferException
public InvalidProtocolBufferException(java.lang.String description, java.lang.Exception e)
-
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
.
-
-