Here you can find the source of multiplyBytes(byte[] in, int count, int mul)
count
bytes of in
mul
times.
Parameter | Description |
---|---|
in | The array of bytes containing the bytes to multiply. |
count | The number of bytes to repeat. |
mul | The number of times to repeat. |
public static byte[] multiplyBytes(byte[] in, int count, int mul)
//package com.java2s; public class Main { /**//from ww w. jav a 2 s. c o m * Repeats <code>count</code> bytes of <code>in</code> <code>mul</code> * times. * * @param in * The array of bytes containing the bytes to multiply. * @param count * The number of bytes to repeat. * @param mul * The number of times to repeat. * @return The repeated bytes. */ public static byte[] multiplyBytes(byte[] in, int count, int mul) { byte[] ret = new byte[count * mul]; for (int x = 0; x < count * mul; x++) { ret[x] = in[x % count]; } return ret; } }