Android Byte Array Encode putChar(byte[] bb, char ch, int index)

Here you can find the source of putChar(byte[] bb, char ch, int index)

Description

put Char

Declaration

public static void putChar(byte[] bb, char ch, int index) 

Method Source Code

//package com.java2s;

public class Main {

    public static void putChar(byte[] bb, char ch, int index) {
        int temp = (int) ch;
        // byte[] b = new byte[2];
        for (int i = 0; i < 2; i++) {
            bb[index + i] = new Integer(temp & 0xff).byteValue(); // ?????????????
            temp = temp >> 8; // ???????8??
        }//from   w w  w  .jav  a2  s . c om
    }
}

Related

  1. encodeWebSafe(byte[] source, boolean doPadding)
  2. encodeWebSafe(byte[] source, boolean doPadding)
  3. encodeWebSafe(byte[] source, boolean doPadding)
  4. encode3to4(byte[] b4, byte[] threeBytes, int numSigBytes, int options)
  5. encode3to4(byte[] source, int srcOffset, int numSigBytes, byte[] destination, int destOffset, int options)
  6. putDouble(byte[] bb, double x, int index)
  7. putInt(int value, int offset, byte[] byteArr)
  8. putInts(int[] fromInts, byte[] toBytes)
  9. putLong(byte[] bb, long x, int index)