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

public class InvalidProtocolBufferException extends 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:
  • Constructor Details

    • InvalidProtocolBufferException

      public InvalidProtocolBufferException(String description)
    • InvalidProtocolBufferException

      public InvalidProtocolBufferException(Exception e)
    • InvalidProtocolBufferException

      public InvalidProtocolBufferException(String description, Exception e)
    • InvalidProtocolBufferException

      public InvalidProtocolBufferException(IOException e)
    • InvalidProtocolBufferException

      public InvalidProtocolBufferException(String description, IOException e)
  • Method Details

    • setUnfinishedMessage

      public InvalidProtocolBufferException setUnfinishedMessage(MessageLite unfinishedMessage)
      Attaches an unfinished message to the exception to support best-effort parsing in Parser interface.
      Returns:
      this
    • getUnfinishedMessage

      public MessageLite getUnfinishedMessage()
      Returns the unfinished message attached to the exception, or null if no message is attached.
    • unwrapIOException

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