use of org.apache.nifi.stream.io.DataOutputStream in project nifi by apache.
the class SnippetManager method export.
public byte[] export() {
try (final ByteArrayOutputStream baos = new ByteArrayOutputStream();
final DataOutputStream dos = new DataOutputStream(baos)) {
for (final StandardSnippet snippet : getSnippets()) {
final byte[] bytes = StandardSnippetSerializer.serialize(snippet);
dos.writeInt(bytes.length);
dos.write(bytes);
}
return baos.toByteArray();
} catch (final IOException e) {
// won't happen
return null;
}
}
Aggregations