Package org.xmlBlaster.client.protocol.http.common

Examples of org.xmlBlaster.client.protocol.http.common.ObjectInputStreamMicro


         inVec.add(qos);
         inVec.add(content);
         oosm.writeObject(inVec);
        
         ByteArrayInputStream bais = new ByteArrayInputStream(baos.toByteArray());
         ObjectInputStreamMicro oism = new ObjectInputStreamMicro(bais);
         Object obj = oism.readObject();
         assertTrue("hashtable is not of type 'Vector', it is " + obj.getClass().getName(), obj instanceof Vector);
         Vector vec = (Vector)obj;
         assertEquals("wrong number of entries in vector", 6, vec.size());
         Hashtable keyOut = (Hashtable)vec.get(0);
         Hashtable qosOut = (Hashtable)vec.get(1);
View Full Code Here


         hashtable.put("three", "3");
         hashtable.put("four", "4");
        
         oosm.writeObject(hashtable);
         ByteArrayInputStream bais = new ByteArrayInputStream(baos.toByteArray());
         ObjectInputStreamMicro oism = new ObjectInputStreamMicro(bais);
         Object obj = oism.readObject();
         assertTrue("hashtable is not of type 'Hashtable', it is " + obj.getClass().getName(), obj instanceof Hashtable);
         Hashtable table = (Hashtable)obj;
         assertEquals("wrong number of entries in hashtable", hashtable.size(), table.size());
         assertHashtableContent("one", hashtable, table);
         assertHashtableContent("two", hashtable, table);
View Full Code Here

         ObjectOutputStreamMicro oosm = new ObjectOutputStreamMicro(baos);
        
         String testString = "this is\n\na simple\nmultiline string\n";
         oosm.writeObject(testString);
         ByteArrayInputStream bais = new ByteArrayInputStream(baos.toByteArray());
         ObjectInputStreamMicro oism = new ObjectInputStreamMicro(bais);
         Object obj = oism.readObject();
         assertTrue("string is not of type 'String', it is " + obj.getClass().getName(), obj instanceof String);
         String response = (String)obj;
         assertEquals("wrong content for the string", testString, response);
         log.info("testStringIO successfully completed");
      }
View Full Code Here

         byte[] content = "This is the content".getBytes();
        
         int length = ObjectOutputStreamMicro.writeMessage(baos, oid, key, qos, content);
         assertEquals("wrong length returned", oid.length() + key.length() + qos.length() + content.length + 3, length);
         ByteArrayInputStream bais = new ByteArrayInputStream(baos.toByteArray());
         ObjectInputStreamMicro oism = new ObjectInputStreamMicro(bais);

         int size = bais.available();
         assertEquals("wrong length of bytes available", length, size);
         byte[] msg = new byte[size];
         bais.read(msg);
View Full Code Here

TOP

Related Classes of org.xmlBlaster.client.protocol.http.common.ObjectInputStreamMicro

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.