
ALR
By: a guest on
Apr 14th, 2011 | syntax:
Java | size: 0.79 KB | views:
75 | expires: Never
@Test
public void testArrays() throws Exception
{
ShrinkWrap.create(JavaArchive.class, "test.jar").add(MegaByteAsset.newInstance(), "dummy").as(ZipExporter.class)
.exportAsInputStream();
// I want the pipe full
Thread.sleep(1000);
for (int i = 0; i < 3; i++)
{
System.gc();
Runtime.getRuntime().runFinalization();
}
final InputStream in = ShrinkWrap.create(JavaArchive.class, "test.jar").add(MegaByteAsset.newInstance(), "dummy")
.as(ZipExporter.class).exportAsInputStream();
final OutputStream out = new OutputStream()
{
@Override
public void write(int b) throws IOException
{
// NOOP
}
};
IOUtil.copyWithClose(in, out);
}