Package org.jboss.messaging.util

Examples of org.jboss.messaging.util.SafeUTF


   {
      ByteArrayOutputStream bos = new ByteArrayOutputStream();
     
      DataOutputStream dos = new DataOutputStream(bos);
     
      SafeUTF su = new SafeUTF(chunkSize);
     
      su.safeWriteUTF(dos, s);
     
      dos.close();
     
      byte[] bytes = bos.toByteArray();
     
      ByteArrayInputStream bis = new ByteArrayInputStream(bytes);
     
      DataInputStream dis = new DataInputStream(bis);
     
      String s2 = su.safeReadUTF(dis);
     
      assertEquals(s, s2);  
   }
View Full Code Here


     
      DataOutputStream dos = new DataOutputStream(bos);
     
      String s = "abcdefghijklmnopqrstuvwxyz";
     
      SafeUTF su = new SafeUTF(30);
     
      su.safeWriteUTF(dos, s);
     
      dos.close();
     
      byte[] bytes = bos.toByteArray();
     
      ByteArrayInputStream bis = new ByteArrayInputStream(bytes);
     
      DataInputStream dis = new DataInputStream(bis);
     
      String s2 = su.safeReadUTF(dis);
     
      assertEquals(s, s2);
     
      int lastReadBufferSize = su.getLastReadBufferSize();
     
      assertEquals(28, lastReadBufferSize);
     
   }
View Full Code Here

   {
      ByteArrayOutputStream bos = new ByteArrayOutputStream();
     
      DataOutputStream dos = new DataOutputStream(bos);
     
      SafeUTF su = new SafeUTF(chunkSize);
     
      su.safeWriteUTF(dos, s);
     
      dos.close();
     
      byte[] bytes = bos.toByteArray();
     
      ByteArrayInputStream bis = new ByteArrayInputStream(bytes);
     
      DataInputStream dis = new DataInputStream(bis);
     
      String s2 = su.safeReadUTF(dis);
     
      assertEquals(s, s2);  
   }
View Full Code Here

     
      DataOutputStream dos = new DataOutputStream(bos);
     
      String s = "abcdefghijklmnopqrstuvwxyz";
     
      SafeUTF su = new SafeUTF(30);
     
      su.safeWriteUTF(dos, s);
     
      dos.close();
     
      byte[] bytes = bos.toByteArray();
     
      ByteArrayInputStream bis = new ByteArrayInputStream(bytes);
     
      DataInputStream dis = new DataInputStream(bis);
     
      String s2 = su.safeReadUTF(dis);
     
      assertEquals(s, s2);
     
      int lastReadBufferSize = su.getLastReadBufferSize();
     
      assertEquals(28, lastReadBufferSize);     
   }
View Full Code Here

TOP

Related Classes of org.jboss.messaging.util.SafeUTF

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.