org.ssf4j.xstream.XStreamDeserializer Maven / Gradle / Ivy
package org.ssf4j.xstream;
import java.io.IOException;
import java.io.InputStream;
import org.ssf4j.Deserializer;
import com.thoughtworks.xstream.XStream;
public class XStreamDeserializer implements Deserializer {
protected XStream xstream;
protected Class type;
protected InputStream in;
public XStreamDeserializer(XStream xstream, InputStream in, Class type) {
this.xstream = xstream != null ? xstream : new XStream();
this.in = in;
this.type = type;
}
@Override
public T read() throws IOException {
return type.cast(xstream.fromXML(in));
}
@Override
public void close() throws IOException {
in.close();
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy