Package org.hornetq.utils

Examples of org.hornetq.utils.Random


   {
      HornetQBuffer buffer = HornetQBuffers.fixedBuffer(60 * 1024);

      byte[] bytes = new byte[20000];

      Random random = new Random();
      random.getRandom().nextBytes(bytes);

      String str = new String(bytes);

      UTF8Util.saveUTF(buffer, str);

View Full Code Here


   public void testValidateUTFOnDataInput() throws Exception
   {
      for (int i = 0; i < 100; i++)
      {
         Random random = new Random();

         // Random size between 15k and 20K
         byte[] bytes = new byte[15000 + RandomUtil.randomPositiveInt() % 5000];

         random.getRandom().nextBytes(bytes);

         String str = new String(bytes);

         // The maximum size the encoded UTF string would reach is str.length * 3 (look at the UTF8 implementation)
         testValidateUTFOnDataInputStream(str,
View Full Code Here

   {
      HornetQBuffer buffer = HornetQBuffers.fixedBuffer(60 * 1024);

      byte[] bytes = new byte[20000];

      Random random = new Random();
      random.getRandom().nextBytes(bytes);

      String str = new String(bytes);

      UTF8Util.saveUTF(buffer, str);

View Full Code Here

   public void testValidateUTFOnDataInput() throws Exception
   {
      for (int i = 0; i < 100; i++)
      {
         Random random = new Random();

         // Random size between 15k and 20K
         byte[] bytes = new byte[15000 + RandomUtil.randomPositiveInt() % 5000];

         random.getRandom().nextBytes(bytes);

         String str = new String(bytes);

         // The maximum size the encoded UTF string would reach is str.length * 3 (look at the UTF8 implementation)
         testValidateUTFOnDataInputStream(str,
View Full Code Here

TOP

Related Classes of org.hornetq.utils.Random

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.