byte To String via Integer.toString - Java java.lang

Java examples for java.lang:byte

Description

byte To String via Integer.toString

Demo Code


//package com.java2s;

public class Main {
    public static void main(String[] argv) throws Exception {
        byte b = 2;
        System.out.println(byteToString(b));
    }/*from   ww w.j av a 2  s. c o  m*/

    public static String byteToString(byte b) {
        return Integer.toString(b & 0xff);
    }
}

Related Tutorials