@Override public void writeObject(Object obj) throws IOException { mH2o.writeObject(obj); }
@Override public void writeObject(Object obj) throws IOException { mH2o.writeObject(obj); }
/** * Writes a complete method call. */ @Override public void call(String method, Object[] args) throws IOException { int length = args != null ? args.length : 0; startCall(method, length); for (int i = 0; i < args.length; i++) writeObject(args[i]); completeCall(); }
/** * Starts the streaming message * <p> * <p>A streaming message starts with 'P'</p> * <p> * <pre> * P x02 x00 * </pre> */ public void writeStreamingObject(Object obj) throws IOException { startStreamingPacket(); writeObject(obj); endStreamingPacket(); }
public void writeObject(Object obj) throws IOException { mH2o.writeObject(obj); }
public void writeObject(Object obj) throws IOException { mH2o.writeObject(obj); }
@Override public void writeObject(Object obj) throws IOException { mH2o.writeObject(obj); }
@Override public void writeObject(Object obj) throws IOException { mH2o.writeObject(obj); }
@Override public void writeObject(Object obj) throws IOException { mH2o.writeObject(obj); }
@Override public void writeObject(Object obj) throws IOException { mH2o.writeObject(obj); }
private byte[] serializeObject(Object object) throws IOException { ByteArrayOutputStream os = new ByteArrayOutputStream(); Hessian2Output hout = new Hessian2Output(os); hout.writeObject(object); hout.close(); byte[] result = os.toByteArray(); os.close(); return result; }
/** * Writes a complete method call. */ @Override public void call(String method, Object[] args) throws IOException { int length = args != null ? args.length : 0; startCall(method, length); for (int i = 0; i < args.length; i++) writeObject(args[i]); completeCall(); }
/** * Writes a complete method call. */ @Override public void call(String method, Object[] args) throws IOException { int length = args != null ? args.length : 0; startCall(method, length); for (int i = 0; i < args.length; i++) writeObject(args[i]); completeCall(); }
/** * Writes a complete method call. */ @Override public void call(String method, Object []args) throws IOException { int length = args != null ? args.length : 0; startCall(method, length); for (int i = 0; i < args.length; i++) writeObject(args[i]); completeCall(); }
/** * Starts the streaming message * <p> * <p>A streaming message starts with 'P'</p> * <p> * <pre> * P x02 x00 * </pre> */ public void writeStreamingObject(Object obj) throws IOException { startStreamingPacket(); writeObject(obj); endStreamingPacket(); }
/** * Writes a complete method call. */ @Override public void call(String method, Object []args) throws IOException { int length = args != null ? args.length : 0; startCall(method, length); for (int i = 0; i < args.length; i++) writeObject(args[i]); completeCall(); }
/** * Writes a complete method call. */ @Override public void call(String method, Object []args) throws IOException { int length = args != null ? args.length : 0; startCall(method, length); for (int i = 0; i < args.length; i++) writeObject(args[i]); completeCall(); }
/** * Starts the streaming message * <p> * <p>A streaming message starts with 'P'</p> * <p> * <pre> * P x02 x00 * </pre> */ public void writeStreamingObject(Object obj) throws IOException { startStreamingPacket(); writeObject(obj); endStreamingPacket(); }
public static byte[] encode(Object obj) throws IOException { ByteArrayOutputStream os = new ByteArrayOutputStream(1024); Hessian2Output h2o = new Hessian2Output(os); h2o.setSerializerFactory(serializerFactory); try { h2o.writeObject(obj); } finally { closeableQuietly(os); closeQuietly(h2o); } return os.toByteArray(); }