Here you can find the source of fillArrayWith(byte[] dest, byte[] pattern)
static public void fillArrayWith(byte[] dest, byte[] pattern)
//package com.java2s; /******************************************************************************* * Copyright (c) 2009 Clark N. Hobbie//from ww w.j av a 2 s. co m * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Clark N. Hobbie - initial API and implementation *******************************************************************************/ public class Main { static public void fillArrayWith(byte[] dest, byte[] pattern) { int count = 0; while (count < dest.length) { for (int i = 0; i < pattern.length; i++) { dest[count] = pattern[i]; count++; } } } }