Java Array Multiply multiplyBytes(byte[] in, int count, int mul)

Here you can find the source of multiplyBytes(byte[] in, int count, int mul)

Description

Repeats count bytes of in mul times.

License

Open Source License

Parameter

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.

Return

The repeated bytes.

Declaration

public static byte[] multiplyBytes(byte[] in, int count, int mul) 

Method Source Code

//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;
    }
}

Related

  1. multiply(String[] strings, String placeholder, String[] replacements)
  2. multiplyAndSum(double[] r1, double[] r2)
  3. multiplyAndSum(final double[] d, final double scale)
  4. multiplyArray(float[] array, float num)
  5. multiplyByScalar(double scalar, double[] vector)
  6. multiplyComplex(double[] one, double[] two)
  7. multiplyComplexVectors(float[] cA, float[] cB, long limit)
  8. multiplycst(int k, double[] t)
  9. multiplyElementwise(double[] a, int[] b)