@Override public Object deserialize(final byte[] bytes, final Type returnType) throws Exception { if (null == bytes || bytes.length == 0) { return null; } ByteArrayInputStream inputStream = new ByteArrayInputStream(bytes); AbstractHessianInput input = new Hessian2Input(inputStream); input.setSerializerFactory(SERIALIZER_FACTORY); Object obj = input.readObject(); input.close(); return obj; }
@Override public Object readObject(AbstractHessianInput in, Object[] fields) throws IOException { try { WeakReference<Object> obj = instantiate(); in.addRef(obj); Object value = in.readObject(); obj = null; return new WeakReference<Object>(value); } catch (IOException e) { throw e; } catch (Exception e) { throw new IOExceptionWrapper(e); } }
@Override public Object readObject(AbstractHessianInput in, Object[] fields) throws IOException { try { SoftReference<Object> obj = instantiate(); in.addRef(obj); Object value = in.readObject(); obj = null; return new SoftReference<Object>(value); } catch (IOException e) { throw e; } catch (Exception e) { throw new IOExceptionWrapper(e); } }
@Override void deserialize(AbstractHessianInput in, Object obj) throws IOException { in.readObject(); } }
@Override public Object readObject(AbstractHessianInput in) throws IOException { return in.readObject(); }
@Override void deserialize(AbstractHessianInput in, Object obj) throws IOException { in.readObject(); } }
@Override void deserialize(AbstractHessianInput in, Object obj) throws IOException { in.readObject(); } }
/** * {@inheritDoc} * * @see marshalsec.MarshallerBase#unmarshal(java.lang.Object) */ @Override public Object unmarshal ( byte[] data ) throws Exception { ByteArrayInputStream bis = new ByteArrayInputStream(data); AbstractHessianInput in = createInput(bis); return in.readObject(); }
public Object readMap(AbstractHessianInput in) throws IOException { Object obj = in.readObject(); String className = getClass().getName(); if (obj != null) throw error(className + ": unexpected object " + obj.getClass().getName() + " (" + obj + ")"); else throw error(className + ": unexpected null value"); }
public Object readMap(AbstractHessianInput in) throws IOException { Object obj = in.readObject(); String className = getClass().getName(); if (obj != null) throw error(className + ": unexpected object " + obj.getClass().getName() + " (" + obj + ")"); else throw error(className + ": unexpected null value"); }
public Object readObject(AbstractHessianInput in) throws IOException { Object obj = in.readObject(); String className = getClass().getName(); if (obj != null) throw error(className + ": unexpected object " + obj.getClass().getName() + " (" + obj + ")"); else throw error(className + ": unexpected null value"); }
public Object readObject(AbstractHessianInput in) throws IOException { Object obj = in.readObject(); String className = getClass().getName(); if (obj != null) throw error(className + ": unexpected object " + obj.getClass().getName() + " (" + obj + ")"); else throw error(className + ": unexpected null value"); }
public Object readMap(AbstractHessianInput in) throws IOException { Object obj = in.readObject(); String className = getClass().getName(); if (obj != null) throw error(className + ": unexpected object " + obj.getClass().getName() + " (" + obj + ")"); else throw error(className + ": unexpected null value"); }
public Object readObject(AbstractHessianInput in) throws IOException { Object obj = in.readObject(); if (obj != null) throw error("expected list at " + obj.getClass().getName() + " (" + obj + ")"); else throw error("expected list at null"); } }
public Object readObject(AbstractHessianInput in, String []fieldNames) throws IOException { String initValue = null; for (int i = 0; i < fieldNames.length; i++) { if ("value".equals(fieldNames[i])) initValue = in.readString(); else in.readObject(); } return create(initValue); }
public Object readObject(AbstractHessianInput in, String []fieldNames) throws IOException { String initValue = null; for (int i = 0; i < fieldNames.length; i++) { if ("value".equals(fieldNames[i])) initValue = in.readString(); else in.readObject(); } return create(initValue); }
public Object readLengthList(AbstractHessianInput in, int length) throws IOException { Collection list = createList(); in.addRef(list); for (; length > 0; length--) list.add(in.readObject()); return list; }
public Object readList(AbstractHessianInput in, int length) throws IOException { Vector list = new Vector(); in.addRef(list); while (! in.isEnd()) list.add(in.readObject()); in.readEnd(); return list.elements(); } }
@Override public Object readList(AbstractHessianInput in, int length) throws IOException { ArrayList list = new ArrayList(); in.addRef(list); while (! in.isEnd()) list.add(in.readObject()); in.readEnd(); return list.iterator(); } }
public Object readList(AbstractHessianInput in, int length) throws IOException { Collection list = createList(); in.addRef(list); while (! in.isEnd()) list.add(in.readObject()); in.readEnd(); return list; }