Properties props = fFactory.createPropertiesData(properties);
return props;
}
public ContentStream createContent() {
ContentStreamImpl content = new ContentStreamImpl();
content.setFileName("data.txt");
content.setMimeType("text/plain");
int len = 32 * 1024;
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 i = 0; i < 1024; i++)
ba.write(b);
} catch (IOException e) {
throw new RuntimeException("Failed to fill content stream with data", e);
}
content.setStream(new ByteArrayInputStream(ba.toByteArray()));
content.setLength(BigInteger.valueOf(len));
return content;
}