@Test public void testEmpty() throws IOException { final Multipart form = new Multipart(); final InputStream inputStream = MultipartUtils.serializeMultipartForm(form); final Collection<Part> parts = Multipart.read(form.getContentType(), -1, inputStream).getParts(); assertTrue(parts.isEmpty()); }
public static InputStream serializeMultipartForm(final Multipart form) throws IOException { try (final ByteArrayOutputStream outputStream = new ByteArrayOutputStream()) { serializeMultipartForm(form, outputStream); return new ByteArrayInputStream(outputStream.toByteArray()); } }
MultipartUtils { public static InputStream serializeMultipartForm(final Multipart form) throws IOException { try (final ByteArrayOutputStream outputStream = new ByteArrayOutputStream()) { serializeMultipartForm(form, outputStream); return new ByteArrayInputStream(outputStream.toByteArray()); } } }
MultipartUtils { public static InputStream serializeMultipartForm(final Multipart form) throws IOException { try (final ByteArrayOutputStream outputStream = new ByteArrayOutputStream()) { serializeMultipartForm(form, outputStream); return new ByteArrayInputStream(outputStream.toByteArray()); } } MultipartUtils(); }
MultipartUtils { public static InputStream serializeMultipartForm(final Multipart form) throws IOException { try (final ByteArrayOutputStream outputStream = new ByteArrayOutputStream()) { serializeMultipartForm(form, outputStream); return new ByteArrayInputStream(outputStream.toByteArray()); } } MultipartUtils(); static InputStream serializeMultipartForm(final Multipart form); static void serializeMultipartForm(final Multipart form, final OutputStream outputStream); }
MultipartUtils { public static InputStream serializeMultipartForm(final Multipart form) throws IOException { try (final ByteArrayOutputStream outputStream = new ByteArrayOutputStream()) { serializeMultipartForm(form, outputStream); return new ByteArrayInputStream(outputStream.toByteArray()); } } MultipartUtils(); static InputStream serializeMultipartForm(final Multipart form); static void serializeMultipartForm(final Multipart form, final OutputStream outputStream);  }