Convert the bytes within the specified range of the given byte array into a String. The range extends from start till, but not including end . @param b the bytes @param start the first byte offset @param end the last byte offset @return the String
(byte[] b, int start, int end)
| 217 | * @return the String |
| 218 | */ |
| 219 | public static String toString(byte[] b, int start, int end) { |
| 220 | int size = end - start; |
| 221 | char[] theChars = new char[size]; |
| 222 | |
| 223 | for (int i = 0, j = start; i < size; ) |
| 224 | theChars[i++] = (char)(b[j++]&0xff); |
| 225 | |
| 226 | return new String(theChars); |
| 227 | } |
| 228 | |
| 229 | /** |
| 230 | * Convert the bytes into a String. |
no test coverage detected