Package org.jboss.util.stream

Examples of org.jboss.util.stream.MarshalledValueInputStream.readShort()


   public Object objectFromByteBuffer(byte[] bytes, int offset, int len) throws IOException, ClassNotFoundException {
      int versionId;
      ObjectInputStream in = new MarshalledValueInputStream(new ByteArrayInputStream(bytes, offset, len));
      try {
         versionId = in.readShort();
         log.trace("Read version {0}", versionId);
      }
      catch (Exception e) {
         log.error("Unable to read version id from first two bytes of stream, barfing.");
         throw new IOException("Unable to read version id from first two bytes of stream.");
View Full Code Here


      int versionId;
      ObjectInputStream in = new MarshalledValueInputStream(new ByteArrayInputStream(bytes, offset, len));

      try
      {
         versionId = in.readShort();
         if (trace) log.trace("Read version " + versionId);
      }
      catch (Exception e)
      {
         log.error("Unable to read version id from first two bytes of stream, barfing.");
View Full Code Here

      int versionId;
      ObjectInputStream in = new MarshalledValueInputStream(new ByteArrayInputStream(buf));

      try
      {
         versionId = in.readShort();
         if (trace) log.trace("Read version " + versionId);
      }
      catch (Exception e)
      {
         log.error("Unable to read version id from first two bytes of stream, barfing.");
View Full Code Here

         ObjectInputStream in = new MarshalledValueInputStream(is);

         try
         {
            versionId = in.readShort();
            if (trace) log.trace("Read version " + versionId);
         }
         catch (Exception e)
         {
            log.error("Unable to read version id from first two bytes of stream, barfing.");
View Full Code Here

      int versionId;
      ObjectInputStream in = new MarshalledValueInputStream(new ByteArrayInputStream(bytes, offset, len));

      try
      {
         versionId = in.readShort();
         if (trace) log.trace("Read version " + versionId);
      }
      catch (Exception e)
      {
         log.error("Unable to read version id from first two bytes of stream, barfing.");
View Full Code Here

      int versionId;
      ObjectInputStream in = new MarshalledValueInputStream(new ByteArrayInputStream(buf));

      try
      {
         versionId = in.readShort();
         if (trace) log.trace("Read version " + versionId);
      }
      catch (Exception e)
      {
         log.error("Unable to read version id from first two bytes of stream, barfing.");
View Full Code Here

         ObjectInputStream in = new MarshalledValueInputStream(is);

         try
         {
            versionId = in.readShort();
            if (trace) log.trace("Read version " + versionId);
         }
         catch (Exception e)
         {
            log.error("Unable to read version id from first two bytes of stream, barfing.");
View Full Code Here

   {
      VersionAwareMarshaller marshaller = createVAMandRestartCache(Version.getVersionString(Version.getVersionShort()));

      byte[] bytes = marshaller.objectToByteBuffer("Hello");
      ObjectInputStream in = new MarshalledValueInputStream(new ByteArrayInputStream(bytes));
      assertEquals("Version header short should be '30'", 30, in.readShort());
   }

   public void testVersionHeader210() throws Exception
   {
      VersionAwareMarshaller marshaller = createVAMandRestartCache("2.1.0.GA");
View Full Code Here

   {
      VersionAwareMarshaller marshaller = createVAMandRestartCache("2.1.0.GA");

      byte[] bytes = marshaller.objectToByteBuffer("Hello");
      ObjectInputStream in = new MarshalledValueInputStream(new ByteArrayInputStream(bytes));
      assertEquals("Version header short should be '21'", 21, in.readShort());
   }

   public void testVersionHeader200() throws Exception
   {
      VersionAwareMarshaller marshaller = createVAMandRestartCache("2.0.0.GA");
View Full Code Here

   {
      VersionAwareMarshaller marshaller = createVAMandRestartCache("2.0.0.GA");

      byte[] bytes = marshaller.objectToByteBuffer("Hello");
      ObjectInputStream in = new MarshalledValueInputStream(new ByteArrayInputStream(bytes));
      assertEquals("Version header short should be '20'", 20, in.readShort());
   }
}
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.