byte[] requestByteArray = ByteUtils.stringToByteArray(transactionContextContent); ByteArrayInputStream bais = new ByteArrayInputStream(requestByteArray); HessianInput input = new HessianInput(bais); try { TransactionContext remoteTransactionContext = (TransactionContext) input.readObject(); remoteTransactionContext.setPropagatedBy(propagatedBy); request.setTransactionContext(remoteTransactionContext);
try { bais = new ByteArrayInputStream(in); input = new HessianInput(bais); input.startReply(); obj = input.readObject(); input.completeReply();
@Override public <T> T deserialize(InputStream input, Class<T> objectClass) throws IOException { HessianInput in = new HessianInput(input); in.setSerializerFactory(serializerFactory); return objectClass.cast(in.readObject()); } }
in = new HessianInput(isToUse); if (major >= 2) { out = new Hessian2Output(osToUse);
public static Object read(byte[] data) { ByteArrayInputStream is = new ByteArrayInputStream(data); HessianInput hi = new HessianInput(is); try { return hi.readObject(); } catch (IOException e) { throw new RuntimeException(e); } finally { try { hi.close(); is.close(); } catch (Exception ex) { } } } }
return readObject(); int tag = read(); String type = readType(); String type = readType(); int length = readLength(); int ref = parseInt(); String type = readType(); String url = readString(); return resolveRemote(type, url);
/** * Reads a reply as an object. * If the reply has a fault, throws the exception. */ public Object readReply(Class expectedClass) throws Throwable { int tag = read(); if (tag != 'r') error("expected hessian reply at " + codeName(tag)); int major = read(); int minor = read(); tag = read(); if (tag == 'f') throw prepareFault(); else { _peek = tag; Object value = readObject(expectedClass); completeValueReply(); return value; } }
/** * Starts reading the call, including the headers. * * <p>The call expects the following protocol data * * <pre> * c major minor * m b16 b8 method * </pre> */ public void startCall() throws IOException { readCall(); while (readHeader() != null) { readObject(); } readMethod(); }
HessianCauchoInput(InputStream stream) { this.input = new HessianInput(); input.setSerializerFactory(new JMXSerializerFactory()); input.init(stream); }
/** * Reads a fault. */ private HashMap readFault() throws IOException { HashMap map = new HashMap(); int code = read(); for (; code > 0 && code != 'z'; code = read()) { _peek = code; Object key = readObject(); Object value = readObject(); if (key != null && value != null) map.put(key, value); } if (code != 'z') throw expect("fault", code); return map; }
static public HessianInput createHessianInput(InputStream in) { HessianInput hin = new HessianInput(in); hin.setSerializerFactory(_serializerFactory); return hin; }
public Object readObject(Class cls) throws IOException { return cls == null ? input.readObject() : input.readObject(cls); } }
/** * Creates a new Hessian input stream, initialized with an * underlying input stream. * * @param is the underlying input stream. */ public HessianInput(InputStream is) { init(is); }
public void startCall() throws IOException { input.readCall(); }
public String readHeader() throws IOException { return input.readHeader(); }
@Override public <T> T deserialize(byte[] serializedObject, Class<T> objectClass) throws IOException { HessianInput in = new HessianInput(new ByteArrayInputStream(serializedObject)); in.setSerializerFactory(serializerFactory); return objectClass.cast(in.readObject()); }
in = new HessianInput(isToUse); if (major >= 2) { out = new Hessian2Output(osToUse);
try { InputStream is = new BufferedInputStream(new FileInputStream(campaignFile)); his = new HessianInput(is); persistedCampaign = (PersistedCampaign) his.readObject(null); } finally { try { his.close(); } catch (Exception e) {
return readObject(); int tag = read(); String type = readType(); String type = readType(); int length = readLength(); int ref = parseInt(); String type = readType(); String url = readString(); return resolveRemote(type, url);
/** * Reads a reply as an object. * If the reply has a fault, throws the exception. */ public Object readReply(Class expectedClass) throws Throwable { int tag = read(); if (tag != 'r') error("expected hessian reply at " + codeName(tag)); int major = read(); int minor = read(); tag = read(); if (tag == 'f') throw prepareFault(); else { _peek = tag; Object value = readObject(expectedClass); completeValueReply(); return value; } }