Here you can find the source of byteToASCII(final byte b)
Parameter | Description |
---|---|
b | the byte to convert |
public static char byteToASCII(final byte b)
//package com.java2s; /*/*ww w . ja va 2 s .co m*/ * Copyright (c) 2014 Stephan D. Cote' - All rights reserved. * * This program and the accompanying materials are made available under the * terms of the MIT License which accompanies this distribution, and is * available at http://creativecommons.org/licenses/MIT/ * * Contributors: * Stephan D. Cote * - Initial API and implementation */ public class Main { /** * Convert a byte to a character representation. * * <p>Sorta misnamed as this method will return the character representation * of the given byte in the current / default encoding for the locale. * * @param b the byte to convert * * @return the ASCII character representation of the byte */ public static char byteToASCII(final byte b) { if ((b < 32) || (b > 126)) { return ' '; } else { return (char) b; } } }