Java tutorial
//package com.java2s; import java.util.Arrays; public class Main { public static byte[] createZeroBytes(int length) { if (length <= 0) throw new IllegalArgumentException("length must be gt 0"); byte[] bytes = new byte[length]; Arrays.fill(bytes, (byte) 0); return bytes; } }