Android Byte Array Convert From toBytes(short value)

Here you can find the source of toBytes(short value)

Description

to Bytes

Declaration

public static byte[] toBytes(short value) 

Method Source Code

//package com.java2s;

public class Main {
    public static byte[] toBytes(short value) {
        byte[] integer = new byte[4];
        integer[0] = (byte) (value & 0x000F);
        integer[1] = (byte) ((value >> 8) & 0x000F);
        return integer;
    }/*from   ww  w. jav a  2  s .c  o m*/
}

Related

  1. toByteObject(String value, Byte defaultValue)
  2. toBytes(char[] chars)
  3. toBytes(int integer)
  4. toBytes(int... byteValue)
  5. toBytes(int... integer)