Here you can find the source of extractString(ByteArrayOutputStream byteBuffer)
static String extractString(ByteArrayOutputStream byteBuffer)
//package com.java2s; //License from project: Apache License import java.io.ByteArrayOutputStream; import java.nio.charset.Charset; public class Main { public static final Charset CHARSET = Charset.forName("UTF-8"); static String extractString(ByteArrayOutputStream byteBuffer) { String string = new String(byteBuffer.toByteArray(), CHARSET); byteBuffer.reset();/* w w w. j av a 2 s .c om*/ return string; } }