Android Byte Array Reverse reverseWordLatin(byte[] b)

Here you can find the source of reverseWordLatin(byte[] b)

Description

reverse Word Latin

Declaration

public static void reverseWordLatin(byte[] b) 

Method Source Code

//package com.java2s;

public class Main {

    public static void reverseWordLatin(byte[] b) {
        int len = 0;
        int size = b.length;
        for (int i = size - 1; i >= 0; i--) {
            if ((b[i] & 0xff) != '\0') {
                len = i + 1;/*www .j  ava 2 s  .  c o  m*/
                break;
            }
        }
        for (int i = 0; i < len / 2; i++) {
            byte tmp = b[i];
            b[i] = b[size - 1 - i];
            b[size - 1 - i] = tmp;
        }
    }
}

Related

  1. reverse(byte[] data)
  2. reverse(byte[] original)
  3. reverseWord(byte[] b)
  4. reverse(byte[] byteArray)
  5. reverseBytes(byte[] bytes)
  6. getReverseBytesInt(byte[] bb, int index)
  7. getReverseBytesLong(byte[] bb, int index)