Java examples for java.lang:byte Array Convert
Convert a signed byte to an int
//package com.java2s; public class Main { public static void main(String[] argv) throws Exception { byte b = 2; System.out.println(signedByteToInt(b)); }//from w ww .j a va 2 s.c o m /** * Convert a signed byte to an int */ public static int signedByteToInt(byte b) { return (int) b; } }