Here you can find the source of arrayToString(final byte[] array, final int start, final int length)
String
, starting at an offset of start
, for length
.
Parameter | Description |
---|---|
array | a parameter |
start | a parameter |
length | a parameter |
public static String arrayToString(final byte[] array, final int start, final int length)
//package com.java2s; // it under the terms of the GNU General Public License as published by public class Main { /*********************************************************************************************** * Convert the contents of the specified array to a <code><b>String</b></code>, * starting at an offset of <code>start</code>, for <code>length</code>. *// w w w.jav a 2s .co m * @param array * @param start * @param length * * @return String */ public static String arrayToString(final byte[] array, final int start, final int length) { int i; int count; final byte[] temp; count = 0; temp = new byte[length]; for (i = start; i < (start + length); i++) { if ((array[i] >= 0) && (array[i] < 32)) { // Control characters are replaced by spaces temp[count] = 32; } else { temp[count] = array[i]; } count++; } return (new String(temp)); } }