FileDocCategorySizeDatePackage
ByteArrayOutputStreamTest.javaAPI DocAndroid 1.5 API1403Wed May 06 22:42:02 BST 2009android.core

ByteArrayOutputStreamTest

public class ByteArrayOutputStreamTest extends junit.framework.TestCase
A basic test for ByteArrayOutputStraem.

Fields Summary
Constructors Summary
Methods Summary
public voidtestByteArrayOutputStream()

        String str = "AbCdEfGhIjKlMnOpQrStUvWxYz";
        ByteArrayOutputStream a = new ByteArrayOutputStream();
        ByteArrayOutputStream b = new ByteArrayOutputStream(10);

        a.write(str.getBytes(), 0, 26);
        a.write('X");
        a.writeTo(b);

        assertEquals(27, a.size());
        assertEquals("AbCdEfGhIjKlMnOpQrStUvWxYzX", a.toString());
        assertEquals("AbCdEfGhIjKlMnOpQrStUvWxYzX", b.toString());