mirror of
https://github.com/haraldk/TwelveMonkeys.git
synced 2026-05-19 00:00:03 -04:00
32 lines
1012 B
Java
Executable File
32 lines
1012 B
Java
Executable File
package com.twelvemonkeys.io;
|
|
|
|
import java.io.IOException;
|
|
import java.io.InputStream;
|
|
|
|
/**
|
|
* FastByteArrayOutputStreamTestCase
|
|
* <p/>
|
|
*
|
|
* @author <a href="mailto:harald.kuhr@gmail.com">Harald Kuhr</a>
|
|
* @author last modified by $Author: haku $
|
|
* @version $Id: //depot/branches/personal/haraldk/twelvemonkeys/release-2/twelvemonkeys-core/src/test/java/com/twelvemonkeys/io/FastByteArrayOutputStreamTestCase.java#1 $
|
|
*/
|
|
public class FastByteArrayOutputStreamTestCase extends OutputStreamAbstractTestCase {
|
|
protected FastByteArrayOutputStream makeObject() {
|
|
return new FastByteArrayOutputStream(256);
|
|
}
|
|
|
|
public void testCreateInputStream() throws IOException {
|
|
FastByteArrayOutputStream out = makeObject();
|
|
|
|
String hello = "Hello World";
|
|
out.write(hello.getBytes("UTF-8"));
|
|
|
|
InputStream in = out.createInputStream();
|
|
|
|
byte[] read = FileUtil.read(in);
|
|
|
|
assertEquals(hello, new String(read, "UTF-8"));
|
|
}
|
|
}
|