Java Unsigned Int Create toUnsignedInt(byte b)

Here you can find the source of toUnsignedInt(byte b)

Description

to Unsigned Int

License

Apache License

Declaration

public static int toUnsignedInt(byte b) 

Method Source Code

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

public class Main {

    public static int toUnsignedInt(byte b) {
        return (b >= 0) ? b : 256 + b;
    }//  ww w .j a  va  2 s  .co  m

    public static int toUnsignedInt(short s) {
        return (s >= 0) ? s : 65536 + s;
    }
}

Related

  1. toUnsignedInt(byte b)
  2. toUnsignedInt(byte b1, byte b2, byte b3, byte b4)
  3. toUnsignedInt(byte value)
  4. toUnsignedInt(byte x)
  5. toUnsignedInt(byte[] a)