Examples of JBossObjectInputStream


Examples of org.jboss.serial.io.JBossObjectInputStream

        try {
            fis = new FileInputStream(file);
            bufStream = new BufferedInputStream(fis, 2000000);
            if (useJBS)
            {
                oos = new JBossObjectInputStream(bufStream);
            } else
            {
                oos = new ObjectInputStream(bufStream);
            }
View Full Code Here

Examples of org.jboss.serial.io.JBossObjectInputStream

      TestWithBigDecimal obj = TestWithBigDecimal.createTestInstance();
          ByteArrayOutputStream byteout = new ByteArrayOutputStream();
          JBossObjectOutputStream out = new JBossObjectOutputStream (byteout);
          out.writeObject(obj);
          out.flush();
          JBossObjectInputStream inp = new JBossObjectInputStream (new ByteArrayInputStream(byteout.toByteArray()));
          TestWithBigDecimal obj2 = (TestWithBigDecimal)inp.readObject();
          assertTrue(obj!=obj2);
          assertEquals(obj,obj2);
         
          BigDecimal result = obj2.getValue().add(obj2.getValue2());
          System.out.println("result = " + result);
View Full Code Here

Examples of org.jboss.serial.io.JBossObjectInputStream

        Object obj = TestParent.createTestInstance();
        ByteArrayOutputStream byteout = new ByteArrayOutputStream();
        JBossObjectOutputStream out = new JBossObjectOutputStream (byteout);
        out.writeObject(obj);
        out.flush();
        JBossObjectInputStream inp = new JBossObjectInputStream (new ByteArrayInputStream(byteout.toByteArray()));
        Object obj2 = inp.readObject();
        assertTrue(obj!=obj2);
        assertEquals(obj,obj2);
    }
View Full Code Here

Examples of org.jboss.serial.io.JBossObjectInputStream

        Object obj = new TestClassReferenceTest();
        ByteArrayOutputStream byteout = new ByteArrayOutputStream();
        JBossObjectOutputStream out = new JBossObjectOutputStream (byteout);
        out.writeObject(obj);
        out.flush();
        JBossObjectInputStream inp = new JBossObjectInputStream (new ByteArrayInputStream(byteout.toByteArray()));
        Object obj2 = inp.readObject();
        assertTrue(obj!=obj2);
        assertEquals(obj,obj2);
    }
View Full Code Here

Examples of org.jboss.serial.io.JBossObjectInputStream

        ByteArrayOutputStream byteout = new ByteArrayOutputStream();
        JBossObjectOutputStream out = new JBossObjectOutputStream (byteout);
        out.writeObject(proxy);
        out.flush();
        JBossObjectInputStream inp = new JBossObjectInputStream (new ByteArrayInputStream(byteout.toByteArray()));
        InterfaceForProxy proxy2 = (InterfaceForProxy)inp.readObject();
        assertEquals(6,proxy2.doSomething());
    }
View Full Code Here

Examples of org.jboss.serial.io.JBossObjectInputStream

      
       objOut.writeObject(largeString);
       objOut.close();
      
       ByteArrayInputStream byteInput = new ByteArrayInputStream(byteArray.toByteArray());
       JBossObjectInputStream objInp = new JBossObjectInputStream(byteInput);
      
       String newString = (String)objInp.readObject();
      
       assertEquals(largeString.length(), newString.length());
       assertEquals(largeString,newString);

    }
View Full Code Here

Examples of org.jboss.serial.io.JBossObjectInputStream

   private static boolean trace = log.isTraceEnabled();

   public ObjectInputStream createInput(InputStream input, ClassLoader loader) throws IOException
   {
      if (trace) { log.trace(this + " creating JBossObjectInputStream"); }
      return new JBossObjectInputStream(input, loader, new StringUtilBuffer(10024, 10024));
   }
View Full Code Here

Examples of org.jboss.serial.io.JBossObjectInputStream

   private static boolean trace = log.isTraceEnabled();

   public ObjectInputStream createInput(InputStream input, ClassLoader loader) throws IOException
   {
      if (trace) { log.trace(this + " creating JBossObjectInputStream"); }
      return new JBossObjectInputStream(input, loader, new StringUtilBuffer(10024, 10024));
   }
View Full Code Here

Examples of org.jboss.serial.io.JBossObjectInputStream

   private static boolean trace = log.isTraceEnabled();

   public ObjectInputStream createInput(InputStream input, ClassLoader loader) throws IOException
   {
      if (trace) { log.trace(this + " creating JBossObjectInputStream"); }
      return new JBossObjectInputStream(input, loader, new StringUtilBuffer(10024, 10024));
   }
View Full Code Here

Examples of org.jboss.serial.io.JBossObjectInputStream

  public String getContentType() {
    return "application/jboss-serialization";
  }

  public Serializable deserialize(Class<? extends Serializable> baseClass, InputStream in) throws IOException {
    ObjectInputStream oo = new JBossObjectInputStream(in);
    try {
      return (Serializable)oo.readObject();
    } catch (ClassNotFoundException e) {// 此异常是运行期不可恢复的错误,不应强制调用者捕获
      throw new IOException("序列化类文件找不到:" + e.getMessage());
    }
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.