Java Unsigned Byte Create toUnsignedByte(byte[] buf, int pos)

Here you can find the source of toUnsignedByte(byte[] buf, int pos)

Description

to Unsigned Byte

License

Apache License

Declaration

public static int toUnsignedByte(byte[] buf, int pos) 

Method Source Code

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

public class Main {
    public static int toUnsignedByte(byte[] buf, int pos) {
        int b = buf[pos];
        if (b < 0) {
            b = 256 + b;//from   ww w  .  j ava  2  s .  com
        }
        return b;
    }
}

Related

  1. toUnsignedByte(byte b)
  2. toUnsignedByte(byte b)
  3. toUnsignedByte(byte b)
  4. toUnsignedByte(byte b)
  5. toUnsignedByte(byte value)
  6. toUnsignedByte(char[] bytes, boolean le)
  7. toUnsignedByte(int value)
  8. toUnsignedByte(int value)
  9. toUnsignedByteArray(byte[] b)