我必须将XML格式的某些类封送到文件(没有xml扩展名)作为标题,然后在文件末尾附加一些无效内容。在那之后,显然我想用JAXB unmarshaller解组这个类,但是我遇到了一个问题 - 它返回null,因为该文件不再是有效的xml(没有额外的内容,所有工作都很完美)。
我的文件如下:
SpoutConfig spoutConfig = new SpoutConfig(hosts, topic, zkRoot, consumerGroupId);
spoutConfig.fetchSizeBytes = 3048576;
spoutConfig.bufferSizeBytes = 3048576;
是否可以解组文件的xml有效部分? 谢谢你的帮助。