Package com.caucho.hessian.io

Examples of com.caucho.hessian.io.Hessian2Input


      if (debugOutputStreamAvailable) {
        osToUse = DebugStreamFactory.createDebugOutputStream(outputStream, debugWriter);
      }
    }

    Hessian2Input in = new Hessian2Input(isToUse);
    if (this.serializerFactory != null) {
      in.setSerializerFactory(this.serializerFactory);
    }

    int code = in.read();
    if (code != 'c') {
      throw new IOException("expected 'c' in hessian input at " + code);
    }

    AbstractHessianOutput out = null;
    int major = in.read();
    int minor = in.read();
    if (major >= 2) {
      out = new Hessian2Output(osToUse);
    }
    else {
      out = new HessianOutput(osToUse);
View Full Code Here


        OutputStream outputStream = arg1.getOutputStream();
        /*
         *This works only with hessian >= hessian-3.0.20!!
         *but remember this is not a framework 
         */
        Hessian2Input hessianInput = new Hessian2Input(inputStream);
        if (this.serializerFactory != null) {
                hessianInput.setSerializerFactory(this.serializerFactory);
        }

        int code = hessianInput.read();
        if (code != 'c') {
                throw new IOException("expected 'c' in hessian input at " + code);
        }

        AbstractHessianOutput  hessianOutput = null;
        int major = hessianInput.read();
        // useless read just get the stream in the right position.
        int minor = hessianInput.read();
        if (major >= 2) {
                hessianOutput = new Hessian2Output(outputStream);
        }
        else {
                hessianOutput = new HessianOutput(outputStream);
View Full Code Here

      if (debugOutputStreamAvailable) {
        osToUse = DebugStreamFactory.createDebugOutputStream(outputStream, debugWriter);
      }
    }

    Hessian2Input in = new Hessian2Input(isToUse);
    if (this.serializerFactory != null) {
      in.setSerializerFactory(this.serializerFactory);
    }

    int code = in.read();
    if (code != 'c') {
      throw new IOException("expected 'c' in hessian input at " + code);
    }

    AbstractHessianOutput out = null;
    int major = in.read();
    int minor = in.read();
    if (major >= 2) {
      out = new Hessian2Output(osToUse);
    }
    else {
      out = new HessianOutput(osToUse);
    }
    if (this.serializerFactory != null) {
      out.setSerializerFactory(this.serializerFactory);
    }

    try {
      this.skeleton.invoke(in, out);
    }
    finally {
      try {
        in.close();
        isToUse.close();
      }
      catch (IOException ex) {
      }
      try {
View Full Code Here

    System.out.println(bos.size()+","+Arrays.toString(bos.toByteArray()));
    return new ByteArrayInputStream(bos.toByteArray());
  }
 
  public static void readObject_Hessian(InputStream in) throws IOException{
    Hessian2Input hin=new Hessian2Input(in);
    Object o=hin.readObject();
    System.out.println(o);
  }
View Full Code Here

    out.close();
  }

  protected Hessian2Input createHessian2Input(InputStream is) {
    return new Hessian2Input(is);
  }
View Full Code Here

        major = isToUse.read();
        minor = isToUse.read();
        if (major != 0x02) {
          throw new IOException("Version " + major + "." + minor + " is not understood");
        }
        in = new Hessian2Input(isToUse);
        out = new Hessian2Output(osToUse);
        in.readCall();
      }
      else if (code == 'C') {
        // Hessian 2.0 call... for some reason not handled in HessianServlet!
        isToUse.reset();
        in = new Hessian2Input(isToUse);
        out = new Hessian2Output(osToUse);
        in.readCall();
      }
      else if (code == 'c') {
        // Hessian 1.0 call
View Full Code Here

        major = isToUse.read();
        minor = isToUse.read();
        if (major != 0x02) {
          throw new IOException("Version " + major + "." + minor + " is not understood");
        }
        in = new Hessian2Input(isToUse);
        out = new Hessian2Output(osToUse);
        in.readCall();
      }
      else if (code == 'C') {
        // Hessian 2.0 call... for some reason not handled in HessianServlet!
        isToUse.reset();
        in = new Hessian2Input(isToUse);
        out = new Hessian2Output(osToUse);
        in.readCall();
      }
      else if (code == 'c') {
        // Hessian 1.0 call
View Full Code Here

      PrintWriter debugWriter = new PrintWriter(new CommonsLogWriter(this.debugLogger));
      isToUse = new HessianDebugInputStream(inputStream, debugWriter);
      osToUse = new HessianDebugOutputStream(outputStream, debugWriter);
    }

    Hessian2Input in = new Hessian2Input(isToUse);
    if (this.serializerFactory != null) {
      in.setSerializerFactory(this.serializerFactory);
    }

    int code = in.read();
    if (code != 'c') {
      throw new IOException("expected 'c' in hessian input at " + code);
    }

    AbstractHessianOutput out = null;
    int major = in.read();
    int minor = in.read();
    if (major >= 2) {
      out = new Hessian2Output(osToUse);
    }
    else {
      out = new HessianOutput(osToUse);
View Full Code Here

public class HessianObjectInput implements CougarObjectInput {
 
  private Hessian2Input hessian2Input;

  HessianObjectInput(InputStream is, SerializerFactory serializerFactory) {
    hessian2Input = new Hessian2Input(is);
        hessian2Input.setSerializerFactory(serializerFactory);
  }
View Full Code Here

        hession2Output.writeObject(data);
        hession2Output.close();
    }

    public Object deserialize(Class clazz, InputStream inputStream) throws IOException {
        Hessian2Input hession2Input = new Hessian2Input(inputStream);
       
        Object result = hession2Input.readObject();
        hession2Input.close();
        return result;
    }
View Full Code Here

TOP

Related Classes of com.caucho.hessian.io.Hessian2Input

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.