Java Byte Print printByte(byte b)

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

Description

Prints a byte.

License

Open Source License

Parameter

Parameter Description
b byte

Declaration

public static void printByte(byte b) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

public class Main {
    /**//from w  w  w.j a v a 2s . c o m
     * Prints a byte.
     *
     * @param b byte
     */
    public static void printByte(byte b) {
        String s1 = String.format("%8s", Integer.toBinaryString(b & 0xFF)).replace(' ', '0');
        System.out.println(s1); // 10000001
    }
}

Related

  1. printByte(byte b)