Examples of nextBytes()


Examples of java.util.Random.nextBytes()

   }
  
   private byte[] createRandomContent(int size) {
      byte[] ret = new byte[size];
      Random random = new Random();
      random.nextBytes(ret);
      return ret;
   }
  
   public void testManyChunks() {
      int maxChunkSize = 128;
View Full Code Here

Examples of java.util.Random.nextBytes()

    public Value createComplexType() throws Exception {
        Random rand = new Random(System.currentTimeMillis());
        byte[] b0 = new byte[0];
        byte[] b1 = new byte[10];
        rand.nextBytes(b1);
        byte[] b2 = new byte[1024];
        rand.nextBytes(b2);

        Value list = ValueFactory.arrayValue(new Value[] {
                ValueFactory.rawValue(b0),
View Full Code Here

Examples of java.util.Random.nextBytes()

        Random rand = new Random(System.currentTimeMillis());
        byte[] b0 = new byte[0];
        byte[] b1 = new byte[10];
        rand.nextBytes(b1);
        byte[] b2 = new byte[1024];
        rand.nextBytes(b2);

        Value list = ValueFactory.arrayValue(new Value[] {
                ValueFactory.rawValue(b0),
                ValueFactory.rawValue(b1),
                ValueFactory.rawValue(b2),
View Full Code Here

Examples of java.util.Random.nextBytes()

  testShort((byte) 1);
  testByte(Byte.MIN_VALUE);
  testByte(Byte.MAX_VALUE);
  byte[] bytes = new byte[1000];
  Random rand = new Random();
  rand.nextBytes(bytes);
  for (int i = 0; i < bytes.length; ++i) {
      testByte(bytes[i]);
  }
    }
View Full Code Here

Examples of java.util.Random.nextBytes()

  // TODO testByteArray(null); // #MN considering next version
  Random rand = new Random(System.currentTimeMillis());
  byte[] b0 = new byte[0];
  testByteArray(b0);
  byte[] b1 = new byte[10];
  rand.nextBytes(b1);
  testByteArray(b1);
  byte[] b2 = new byte[1024];
  rand.nextBytes(b2);
  testByteArray(b2);
    }
View Full Code Here

Examples of java.util.Random.nextBytes()

  testByteArray(b0);
  byte[] b1 = new byte[10];
  rand.nextBytes(b1);
  testByteArray(b1);
  byte[] b2 = new byte[1024];
  rand.nextBytes(b2);
  testByteArray(b2);
    }

    public void testByteArray(byte[] v) throws Exception {
    }
View Full Code Here

Examples of java.util.Random.nextBytes()

  testShort((short) 1);
  testShort(Short.MIN_VALUE);
  testShort(Short.MAX_VALUE);
  Random rand = new Random();
  byte[] bytes = new byte[2000];
  rand.nextBytes(bytes);
  for (int i = 0; i < bytes.length; i = i + 2) {
      testShort((short) ((bytes[i] << 8) | (bytes[i + 1] & 0xff)));
  }
    }
View Full Code Here

Examples of java.util.Random.nextBytes()

  testShortArray(new short[] { Short.MIN_VALUE, Short.MAX_VALUE });
  Random rand = new Random();
  byte[] bytes = new byte[2];
  short[] v = new short[100];
  for (int i = 0; i < v.length; ++i) {
      rand.nextBytes(bytes);
      v[i] = (short) ((bytes[0] << 8) | (bytes[1] & 0xff));
  }
  testShortArray(v);
    }
View Full Code Here

Examples of java.util.Random.nextBytes()

  // FIXME testByteBuffer(null); // #MN considering next version
  Random rand = new Random(System.currentTimeMillis());
  byte[] b0 = new byte[0];
  testByteBuffer(ByteBuffer.wrap(b0));
  byte[] b1 = new byte[10];
  rand.nextBytes(b1);
  testByteBuffer(ByteBuffer.wrap(b1));
  byte[] b2 = new byte[1024];
  rand.nextBytes(b2);
  testByteBuffer(ByteBuffer.wrap(b2));
    }
View Full Code Here

Examples of java.util.Random.nextBytes()

  testByteBuffer(ByteBuffer.wrap(b0));
  byte[] b1 = new byte[10];
  rand.nextBytes(b1);
  testByteBuffer(ByteBuffer.wrap(b1));
  byte[] b2 = new byte[1024];
  rand.nextBytes(b2);
  testByteBuffer(ByteBuffer.wrap(b2));
    }

    public void testByteBuffer(ByteBuffer v) throws Exception {
    }
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.