Java Byte to Int byte2integer(byte b)

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

Description

Converts a Byte value to an Integer value.

License

Apache License

Parameter

Parameter Description
b Byte value

Return

Integer value

Declaration

public static int byte2integer(byte b) 

Method Source Code

//package com.java2s;
/*//from   w w  w .jav a2 s. c  o  m
 * Copyright 2009 Google Inc.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

public class Main {
    /**
     * Converts a Byte value to an Integer value.
     * 
     * @param b  Byte value
     * @return  Integer value
     */
    public static int byte2integer(byte b) {
        return (b << 24) >> 24;
    }
}

Related

  1. byte2int(byte b)
  2. byte2int(byte b)
  3. Byte2Int(byte i)
  4. byte2int(final byte b)
  5. byte2integer(byte b)
  6. byteToInt(byte b)
  7. byteToInt(byte b)
  8. byteToInt(byte b)
  9. byteToInt(byte b0, byte b1, byte b2, byte b3)