com.google.protobuf
Class InvalidProtocolBufferException

java.lang.Object
  extended by java.lang.Throwable
      extended by java.lang.Exception
          extended by java.io.IOException
              extended by com.google.protobuf.InvalidProtocolBufferException
All Implemented Interfaces:
Serializable

public class InvalidProtocolBufferException
extends 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

Constructor Summary
InvalidProtocolBufferException(String description)
           
 
Method Summary
 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 in Parser interface.
 
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

InvalidProtocolBufferException

public InvalidProtocolBufferException(String description)
Method Detail

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.