Example usage for java.io ByteArrayOutputStream toString

List of usage examples for java.io ByteArrayOutputStream toString

Introduction

In this page you can find the example usage for java.io ByteArrayOutputStream toString.

Prototype

public synchronized String toString() 

Source Link

Document

Converts the buffer's contents into a string decoding bytes using the platform's default character set.

Usage

From source file:com.adaptris.util.stream.StreamUtilTest.java

@Test
public void testMakeCopy() throws Exception {
    ByteArrayInputStream in = new ByteArrayInputStream(TEXT.getBytes());
    InputStream in2 = StreamUtil.makeCopy(in);
    ByteArrayOutputStream out = new ByteArrayOutputStream();
    IOUtils.copy(in2, out);/*from   www  .jav  a  2  s  .c om*/
    assertEquals(TEXT, out.toString());
}