Here you can find the source of floatArray2Json(float[] array)
static String floatArray2Json(float[] array)
//package com.java2s; //License from project: Apache License public class Main { static String floatArray2Json(float[] array) { if (array.length == 0) return "[]"; StringBuilder sb = new StringBuilder(array.length << 4); sb.append('['); for (float o : array) { sb.append(Float.toString(o)); sb.append(','); }// w ww . ja va2s . com // set last ',' to ']': sb.setCharAt(sb.length() - 1, ']'); return sb.toString(); } }