Android Byte Array to Unicode Convert lowerToUpper(byte[] b)

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

Description

lower To Upper

Declaration

public static void lowerToUpper(byte[] b) 

Method Source Code

//package com.java2s;

public class Main {

    public static void lowerToUpper(byte[] b) {
        int len = b.length;
        if ((len & 1) == 1) {
            b[len - 1] = '\0';
            len--;//from  ww  w .ja  v  a  2 s.com
        }
        for (int i = 0; i < len; i += 2) {
            int high = b[i] & 0xff;
            int low = b[i + 1] & 0xff;
            if (high == '\0' || low == '\0') {
                break;
            } else if (high == 0x23 && (low >= 0x61 && low <= 0x7a)) {
                b[i + 1] = (byte) (low - 0x20);
            }
        }
    }
}

Related

  1. byteArrayBigEndian2Int(byte[] bs)
  2. byteArrayLittleEndian2Int(byte[] bs)
  3. bytesToAsciiMaybe(byte[] data)
  4. bytesToAsciiMaybe(byte[] data, int offset, int length)
  5. lowerToUpperLatin(byte[] b)
  6. jisx0208ToString(byte[] b)
  7. jisx0208ToString(byte[] b, int offset, int len)
  8. toBase58(byte[] b)