fTimeLoggerDelete.stop();
}
}
private ContentStream createContent() {
ContentStreamImpl content = new ContentStreamImpl();
content.setFileName("data.txt");
content.setMimeType("text/plain");
int len = fContentSizeInK * 1024; // size of document in K
byte[] b = { 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x0c, 0x0a,
0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x0c, 0x0a }; // 32
// Bytes
ByteArrayOutputStream ba = new ByteArrayOutputStream(len);
try {
for (int j = 0; j < fContentSizeInK; j++) {
// write 1K of data
for (int i = 0; i < 32; i++)
ba.write(b);
}
} catch (IOException e) {
throw new RuntimeException("Failed to fill content stream with data", e);
}
content.setStream(new ByteArrayInputStream(ba.toByteArray()));
return content;
}