Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 package org.apache.xmlrpc.parser;
00020
00021 import java.io.ByteArrayInputStream;
00022 import java.io.IOException;
00023 import java.io.ObjectInputStream;
00024
00025 import org.apache.xmlrpc.XmlRpcException;
00026
00027
00030 public class SerializableParser extends ByteArrayParser {
00031 public Object getResult() throws XmlRpcException {
00032 try {
00033 byte[] res = (byte[]) super.getResult();
00034 ByteArrayInputStream bais = new ByteArrayInputStream(res);
00035 ObjectInputStream ois = new ObjectInputStream(bais);
00036 return ois.readObject();
00037 } catch (IOException e) {
00038 throw new XmlRpcException("Failed to read result object: " + e.getMessage(), e);
00039 } catch (ClassNotFoundException e) {
00040 throw new XmlRpcException("Failed to load class for result object: " + e.getMessage(), e);
00041 }
00042 }
00043 }