Java Integer to Byte int2ubyte(int in)

Here you can find the source of int2ubyte(int in)

Description

intubyte

License

Apache License

Declaration

public static final byte int2ubyte(int in) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

public class Main {
    public static final byte int2ubyte(int in) {

        in = ((in < 0) ? 0 - in : in) % 256;
        return (in > 127) ? (byte) (in - 256) : (byte) in;
    }//  w ww.  j a  v a  2s .c om
}

Related

  1. int2byteArray(int k, byte b[], int off)
  2. int2ByteArray(int value)
  3. int2byteArray(int[] i)
  4. int2ByteArrayLength4(int theInt)
  5. int2ToByteArray(int value)
  6. intAsByte(int value)
  7. intTo1Byte(int x)
  8. intTo4Byte(int i)
  9. intToByte(byte[] buf, int off, int value)