Here you can find the source of byteToUnsigned(byte b)
Parameter | Description |
---|---|
b | The byte to be converted. |
static public int byteToUnsigned(byte b)
//package com.java2s; /************************************************************************ * Copyright (c) Crater Dog Technologies(TM). All Rights Reserved. * ************************************************************************ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * * * This code is free software; you can redistribute it and/or modify it * * under the terms of The MIT License (MIT), as published by the Open * * Source Initiative. (See http://opensource.org/licenses/MIT) * ************************************************************************/ public class Main { /**/*from w ww . j a v a 2 s . c o m*/ * This function converts a byte into its unsigned integer form. * * @param b The byte to be converted. * @return The unsigned version of the byte as an integer. */ static public int byteToUnsigned(byte b) { int unsigned = b & 0xFF; return unsigned; } }