Android Byte Array Rotate rotateLeft(byte[] input)

Here you can find the source of rotateLeft(byte[] input)

Description

Moves all bytes one up, meaning the left most byte (0) is swapped to the end

Declaration

public static byte[] rotateLeft(byte[] input) 

Method Source Code

//package com.java2s;

public class Main {
    /**//  w w  w.j  a v a  2s. c om
     * Moves all bytes one up, meaning the left most byte (0) is swapped to the end
     */
    public static byte[] rotateLeft(byte[] input) {
        byte[] cycled = new byte[input.length];
        System.arraycopy(input, 1, cycled, 0, input.length - 1);
        cycled[cycled.length - 1] = input[0];
        return cycled;
    }
}

Related

  1. rotateRight(byte[] input)
  2. unrotate(byte[] data, int blockSizeBytes)