Here you can find the source of arrayToString(int[][] array)
public static String arrayToString(int[][] array)
//package com.java2s; /* ArrayUtil.java 1.0 2010-2-2 * //from w w w .j a va 2s. c om * Copyright (c) 2010 by Chen Zhiwu * All rights reserved. * * The copyright of this software is own by the authors. * You may not use, copy or modify this software, except * in accordance with the license agreement you entered into * with the copyright holders. For details see accompanying license * terms. */ import java.io.ByteArrayOutputStream; public class Main { public static String arrayToString(int[][] array) { ByteArrayOutputStream out = new ByteArrayOutputStream(); for (int i = 0; i < array.length; i++) { for (int j = 0; j < array[0].length; j++) { out.write(array[i][j]); } } return new String(out.toByteArray()); } public static String arrayToString(int[] array) { ByteArrayOutputStream out = new ByteArrayOutputStream(); for (int i = 0; i < array.length; i++) { out.write(array[i]); } return new String(out.toByteArray()); } }