public static byte[] encode(BufferedMessage message) throws MessageFormatException { return encode(message, message.getContent()); }
private static void stream(BufferedMessage message, StreamingMessage stream) { stream.setHeader(message.getHeader()); byte[] content = message.getContent(); if (content != null && content.length > 0) stream.setContent(new ByteArrayInputStream(content)); }