Here you can find the source of asciiBytesToString(byte[] val)
String
assuming the ASCII character set, for use in cases (such as early in the boot process) where character set conversion is unavailable or inadvisable.
Parameter | Description |
---|---|
val | Byte array to convert |
public static String asciiBytesToString(byte[] val)
//package com.java2s; /*/*w w w .j av a 2s .co m*/ * This file is part of the Jikes RVM project (http://jikesrvm.org). * * This file is licensed to You under the Common Public License (CPL); * You may not use this file except in compliance with the License. You * may obtain a copy of the License at * * http://www.opensource.org/licenses/cpl1.0.php * * See the COPYRIGHT.txt file distributed with this work for information * regarding copyright ownership. */ public class Main { /** * Convert a byte array to a <code>String</code> assuming the ASCII * character set, for use in cases (such as early in the boot process) * where character set conversion is unavailable or inadvisable. * * @param val Byte array to convert * @return The resulting string */ public static String asciiBytesToString(byte[] val) { return asciiBytesToString(val, 0, val.length); } /** * Convert a byte array to a <code>String</code> assuming the ASCII * character set, for use in cases (such as early in the boot process) * where character set conversion is unavailable or inadvisable. * * @param val Byte array to convert * @param start Start the string at this byte * @param length Use 'length' bytes * @return The resulting string */ @SuppressWarnings("deprecation") public static String asciiBytesToString(byte[] val, int start, int length) { return new String(val, 0, start, length); } }