31 package com.google.protobuf;
33 import java.io.IOException;
41 public class InvalidProtocolBufferException
extends IOException {
51 super(e.getMessage(), e);
77 void setThrownFromInputStream() {
94 boolean getThrownFromInputStream() {
103 return getCause() instanceof IOException ? (IOException) getCause() :
this;
108 "While parsing a protocol message, the input ended unexpectedly "
109 +
"in the middle of a field. This could mean either that the "
110 +
"input has been truncated or that an embedded message "
111 +
"misreported its own length.");
116 "CodedInputStream encountered an embedded string or message "
117 +
"which claimed to have negative size.");
130 "Protocol message end-group tag did not match expected tag.");
133 static InvalidWireTypeException invalidWireType() {
134 return new InvalidWireTypeException(
"Protocol message tag had invalid wire type.");
149 "Protocol message had too many levels of nesting. May be malicious. "
150 +
"Use CodedInputStream.setRecursionLimit() to increase the depth limit.");
155 "Protocol message was too large. May be malicious. "
156 +
"Use CodedInputStream.setSizeLimit() to increase the size limit.");