Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;

import java.io.ByteArrayOutputStream;

import java.io.UnsupportedEncodingException;

public class Main {
    public static String byteArrayOutStreamToString(ByteArrayOutputStream outputStream) {
        byte[] buf = outputStream.toByteArray();
        try {
            return new String(buf, "UTF-8");
        } catch (UnsupportedEncodingException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
            return "";
        }
    }
}