mirror of
https://github.com/haraldk/TwelveMonkeys.git
synced 2026-05-20 00:00:03 -04:00
moving files around
This commit is contained in:
Executable
+31
@@ -0,0 +1,31 @@
|
||||
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"));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user