Examples of ObjectInput


Examples of java.io.ObjectInput

   @Override
   public Object objectFromByteBuffer(byte[] buf, int offset, int length) throws IOException,
           ClassNotFoundException {
      ByteArrayInputStream is = new ByteArrayInputStream(buf, offset, length);
      ObjectInput unmarshaller = startObjectInput(is, false);
      Object o = null;
      try {
         o = objectFromObjectStream(unmarshaller);
      } finally {
         finishObjectInput(unmarshaller);
View Full Code Here

Examples of java.io.ObjectInput

   }

   @Override
   public Object objectFromByteBuffer(byte[] bytes, int offset, int len) throws IOException, ClassNotFoundException {
      ByteArrayInputStream is = new ByteArrayInputStream(bytes, offset, len);
      ObjectInput in = startObjectInput(is, false);
      Object o = null;
      try {
         o = defaultMarshaller.objectFromObjectStream(in);
      } finally {
         finishObjectInput(in);
View Full Code Here

Examples of java.io.ObjectInput

      defaultMarshaller.objectToObjectStream(obj, out);
   }

   @Override  
   public ObjectInput startObjectInput(InputStream is, boolean isReentrant) throws IOException {
      ObjectInput in = defaultMarshaller.startObjectInput(is, isReentrant);
      int versionId;
      try {
         versionId = in.readShort();
         if (trace) log.trace("Read version {0}", versionId);
      }
      catch (Exception e) {
         finishObjectInput(in);
         log.error("Unable to read version id from first two bytes of stream, barfing.");
View Full Code Here

Examples of java.io.ObjectInput

   @Override
   public Object objectFromByteBuffer(byte[] buf, int offset, int length) throws IOException,
           ClassNotFoundException {
      ByteArrayInputStream is = new ByteArrayInputStream(buf, offset, length);
      ObjectInput unmarshaller = startObjectInput(is, false);
      Object o = null;
      try {
         o = objectFromObjectStream(unmarshaller);
      } finally {
         finishObjectInput(unmarshaller);
View Full Code Here

Examples of java.io.ObjectInput

      return new ByteBuffer(baos.getRawBuffer(), 0, baos.size());
   }

   public Object objectFromByteBuffer(byte[] bytes, int offset, int len) throws IOException, ClassNotFoundException {
      ByteArrayInputStream is = new ByteArrayInputStream(bytes, offset, len);
      ObjectInput in = startObjectInput(is, false);
      Object o = null;
      try {
         o = defaultMarshaller.objectFromObjectStream(in);
      } finally {
         finishObjectInput(in);
View Full Code Here

Examples of java.io.ObjectInput

       */
      defaultMarshaller.objectToObjectStream(obj, out);
   }

   public ObjectInput startObjectInput(InputStream is, boolean isReentrant) throws IOException {
      ObjectInput in = defaultMarshaller.startObjectInput(is, isReentrant);
      int versionId;
      try {
         versionId = in.readShort();
         if (trace) log.trace("Read version {0}", versionId);
      }
      catch (Exception e) {
         finishObjectInput(in);
         log.error("Unable to read version id from first two bytes of stream, barfing.");
View Full Code Here

Examples of java.io.ObjectInput

   }

   public Object objectFromByteBuffer(byte[] buf, int offset, int length) throws IOException,
                                                                                 ClassNotFoundException {
      ByteArrayInputStream is = new ByteArrayInputStream(buf, offset, length);
      ObjectInput unmarshaller = startObjectInput(is, false);
      Object o = null;
      try {
         o = objectFromObjectStream(unmarshaller);
      } finally {
         finishObjectInput(unmarshaller);
View Full Code Here

Examples of java.io.ObjectInput

                    //ObjectInputStream objStream = new ObjectInputStream(bufStream);
                    //Object obj = objStream.readObject();



                    ObjectInput containerInput = new JBossObjectInputStream(bufStream);
                    TestProxy objRead = (TestProxy)containerInput.readObject();
                    int result = objRead.getProxy().doSomething();

                    BufferedOutputStream bufOut = new BufferedOutputStream(socket.getOutputStream());
                    JBossObjectOutputStream objOut = new JBossObjectOutputStream(bufOut);
View Full Code Here

Examples of java.io.ObjectInput

            DataContainer container = new DataContainer(false,buffer);
            ObjectOutput out = container.getOutput();
            out.writeObject(myTest);
            container.flush();

            ObjectInput input = container.getInput();

            Object value = input.readObject();

            if (!(myTest instanceof String[]))
              {
              assertEquals(value,myTest);
              }
View Full Code Here

Examples of java.io.ObjectInput

    public void testClientCall() throws Exception
    {

       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);

       assertEquals(proxy.getProxy().doSomething(),obj.intValue());
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.