Package org.jboss.serial.io

Examples of org.jboss.serial.io.JBossObjectOutputStream.writeObject()


        ByteArrayOutputStream byteOut = new ByteArrayOutputStream();
        JBossObjectOutputStream objout = new JBossObjectOutputStream(byteOut);

        TestProxy proxy = TestProxy.createTestInstance();

        objout.writeObject(proxy);
        objout.flush();

        JBossObjectInputStream objinput = new JBossObjectInputStream(new ByteArrayInputStream(byteOut.toByteArray()));

        TestProxy newProxy = (TestProxy)objinput.readObject();
View Full Code Here


            arrayObj[i] = dataObject;
        }

        ByteArrayOutputStream byteout = new ByteArrayOutputStream();
        JBossObjectOutputStream objOut = new JBossObjectOutputStream(byteout);
        objOut.writeObject(arrayObj);
        objOut.flush();

        JBossObjectInputStream objInput = new JBossObjectInputStream(new ByteArrayInputStream(byteout.toByteArray()));
        Object newObject[] = (Object[]) objInput.readObject();
View Full Code Here

  public void testOne() throws Exception
  {
    Class[] obj = new Class[] {Object[].class};
    ByteArrayOutputStream byteArray = new ByteArrayOutputStream();
    JBossObjectOutputStream jbOut = new JBossObjectOutputStream(byteArray);
    jbOut.writeObject(obj);
    jbOut.flush();
   
    ByteArrayInputStream byteInput = new ByteArrayInputStream(byteArray.toByteArray());
    JBossObjectInputStream jbInpt = new JBossObjectInputStream(byteInput);
    Object newObject = jbInpt.readObject();
View Full Code Here

    public void executTest(Object dataObject) throws Throwable
    {
        System.out.println("Testing = " + dataObject.getClass().getName());
        ByteArrayOutputStream byteout = new ByteArrayOutputStream();
        JBossObjectOutputStream objOut = new JBossObjectOutputStream(byteout);
        objOut.writeObject(dataObject);
        objOut.flush();

        JBossObjectInputStream objInput = new JBossObjectInputStream(new ByteArrayInputStream(byteout.toByteArray()));
        Object newObject = objInput.readObject();
View Full Code Here

       ObjectOutput output = new JBossObjectOutputStream(socket.getOutputStream());
       ObjectInput input = new JBossObjectInputStream((socket.getInputStream()));

       TestProxy proxy = TestProxy.createTestInstance();
       output.writeObject(proxy);
       output.flush();

       Integer obj = (Integer)input.readObject();

       System.out.println("response: " + obj);
View Full Code Here

    {
        Calendar calendar = new GregorianCalendar();
        calendar.setTimeInMillis(System.currentTimeMillis());
        ByteArrayOutputStream byteOut = new ByteArrayOutputStream();
        JBossObjectOutputStream os = new JBossObjectOutputStream(byteOut );
        os.writeObject(calendar);
        os.flush();
        os.close();

        ByteArrayInputStream byteInpt = new ByteArrayInputStream(byteOut.toByteArray());
        JBossObjectInputStream is = new JBossObjectInputStream(byteInpt);
View Full Code Here

              if (i==START_MEASURE)
                    ThreadLocalBenchmark.openBench(dataObject.getClass().getName(),metaData);
                ByteArrayOutputStream outByte = new ByteArrayOutputStream();
                BufferedOutputStream buffOut  = new BufferedOutputStream(outByte);
                ObjectOutputStream output = new JBossObjectOutputStream(buffOut);
                output.writeObject(dataObject);
                output.flush();
                buffOut.flush();

                ByteArrayInputStream inptByte = new ByteArrayInputStream(outByte.toByteArray());
                ObjectInputStream input = new JBossObjectInputStream(inptByte);
View Full Code Here

        try
        {
                ByteArrayOutputStream outByte = new ByteArrayOutputStream();
                BufferedOutputStream buffOut  = new BufferedOutputStream(outByte);
                ObjectOutputStream output = new JBossObjectOutputStream(buffOut);
                output.writeObject(dataObject);
                output.flush();
                buffOut.flush();

                ByteArrayInputStream inptByte = new ByteArrayInputStream(outByte.toByteArray());
                ObjectInputStream input = new JBossObjectInputStream(inptByte);
View Full Code Here

   
   
    ByteArrayOutputStream byteOut = new ByteArrayOutputStream();
    JBossObjectOutputStream objOut = new JBossObjectOutputStream(byteOut);
   
    objOut.writeObject(someInstance);
    objOut.flush();
   
    JBossObjectInputStream objInput = new JBossObjectInputStream(new ByteArrayInputStream(byteOut.toByteArray()),loader);
    Object newObject = objInput.readObject();
View Full Code Here

      method.invoke(rootObject,new Object[]{childObject});
     
      ByteArrayOutputStream byteOut = new ByteArrayOutputStream();
      JBossObjectOutputStream objOut = new JBossObjectOutputStream(byteOut);
     
      objOut.writeObject(rootObject);
      objOut.flush();
     
      loader1 = null;
      testClass=null;
      childObject = null;
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.