byte[] data = new byte[DATA1.length];
int read = is.read(data, 0, DATA1.length);
is.close();
assertEquals("Read-1-SIZE", DATA1.length, read);
assertEquals("Read-1", new ByteArrayWrapper(DATA1), new ByteArrayWrapper(data));
// Write again
os = bucket.getOutputStream();
os.write(DATA2);
os.close();
// Read byte[]
is = bucket.getInputStream();
data = new byte[DATA2.length];
read = is.read(data, 0, DATA2.length);
is.close();
assertEquals("Read-2-SIZE", DATA2.length, read);
assertEquals("Read-2", new ByteArrayWrapper(DATA2), new ByteArrayWrapper(data));
} finally {
freeBucket(bucket);
}
}