Android Byte Array Convert From toByte(int n)

Here you can find the source of toByte(int n)

Description

toByte

License

Open Source License

Parameter

Parameter Description
n a parameter

Declaration

private static byte toByte(int n) 

Method Source Code

//package com.java2s;

public class Main {
    /**/*from  www . ja v  a2  s  . co m*/
     * toByte
     * @param n
     * @return
     */
    private static byte toByte(int n) {
        return (byte) ((n > 127) ? (n - 256) : n);
    }
}

Related

  1. convertIntArrayToByteArray(int[] intArray)
  2. shortToByteArray(short value)
  3. convertLongArrayToByteArray(long[] longArray)
  4. toByte(String value, byte defaultValue)
  5. toByte(int byteValue)
  6. toByteObject(String value, Byte defaultValue)
  7. toBytes(char[] chars)
  8. toBytes(int integer)
  9. toBytes(int... byteValue)