Here you can find the source of newByteArray(int size)
byte[]
the is filled with a repeated sequence of 0x00 to 0xFF.
private static byte[] newByteArray(int size)
//package com.java2s; // Licensed under the Apache License, Version 2.0 (the "License"); public class Main { /**//from w ww .j a v a 2 s. c o m * Generates a <code>byte[]</code> the is filled with a repeated sequence * of 0x00 to 0xFF. This is typically used as a "background" array for * tests. */ private static byte[] newByteArray(int size) { byte[] data = new byte[size]; for (int ii = 0; ii < data.length; ii++) data[ii] = (byte) (ii % 256); return data; } }