@Test(expected=UnrecognizedMessageTypeException.class) public void deserializeWellFormedButConfusedMessage() throws IOException, UnrecognizedMessageTypeException { BinaryMessages.VehicleMessage.Builder builder = BinaryMessages.VehicleMessage.newBuilder(); builder.setTypeValue(42); BinaryMessages.SimpleMessage.Builder messageBuilder = BinaryMessages.SimpleMessage.newBuilder(); BinaryMessages.DynamicField.Builder fieldBuilder = BinaryMessages.DynamicField.newBuilder(); fieldBuilder.setType(BinaryMessages.DynamicField.Type.NUM); fieldBuilder.setNumericValue(42); messageBuilder.setValue(fieldBuilder); builder.setSimpleMessage(messageBuilder); BinaryMessages.VehicleMessage serialized = builder.build(); ByteArrayOutputStream output = new ByteArrayOutputStream(); serialized.writeTo(output); InputStream input = new ByteArrayInputStream(output.toByteArray()); BinaryFormatter.deserialize(input); }
public static VehicleMessage deserialize(InputStream data) throws UnrecognizedMessageTypeException { return BinaryDeserializer.deserialize(data); }
BinaryFormatter { public static VehicleMessage deserialize(InputStream data) throws UnrecognizedMessageTypeException { return BinaryDeserializer.deserialize(data); } }
BinaryFormatter { public static VehicleMessage deserialize(InputStream data) throws UnrecognizedMessageTypeException { return BinaryDeserializer.deserialize(data); }  }
BinaryFormatter { public static VehicleMessage deserialize(InputStream data) throws UnrecognizedMessageTypeException { return BinaryDeserializer.deserialize(data); }  static VehicleMessage deserialize(InputStream data); static byte[] serialize(VehicleMessage message); static MessageLite preSerialize(VehicleMessage message); }
BinaryFormatter { public static VehicleMessage deserialize(InputStream data) throws UnrecognizedMessageTypeException { return BinaryDeserializer.deserialize(data); }  static VehicleMessage deserialize(InputStream data); static byte[] serialize(VehicleMessage message); static MessageLite preSerialize(VehicleMessage message);  }