@Test public void testWriteTo() throws IOException { File file = makeTestFile(temporaryFolder.getRoot()); ParseFileHttpBody body = new ParseFileHttpBody(file); ByteArrayOutputStream output = new ByteArrayOutputStream(); body.writeTo(output); verifyTestFileContent(output.toByteArray()); }
@Override public void writeTo(OutputStream out) throws IOException { if (out == null) { throw new IllegalArgumentException("Output stream can not be null"); } final FileInputStream fileInput = new FileInputStream(file); try { ParseIOUtils.copy(fileInput, out); } finally { ParseIOUtils.closeQuietly(fileInput); } }
ParseFileHttpBody extends ParseHttpBody { @Override public void writeTo(OutputStream out) throws IOException { if (out == null) { throw new IllegalArgumentException("Output stream can not be null"); } final FileInputStream fileInput = new FileInputStream(file); try { ParseIOUtils.copy(fileInput, out); } finally { ParseIOUtils.closeQuietly(fileInput); } } }
ParseFileHttpBody extends ParseHttpBody { @Override public void writeTo(OutputStream out) throws IOException { if (out == null) { throw new IllegalArgumentException("Output stream can not be null"); } final FileInputStream fileInput = new FileInputStream(file); try { ParseIOUtils.copy(fileInput, out); } finally { ParseIOUtils.closeQuietly(fileInput); } } ParseFileHttpBody(File file);  ParseFileHttpBody(File file, String contentType); }
ParseFileHttpBody extends ParseHttpBody { @Override public void writeTo(OutputStream out) throws IOException { if (out == null) { throw new IllegalArgumentException("Output stream can not be null"); } final FileInputStream fileInput = new FileInputStream(file); try { ParseIOUtils.copy(fileInput, out); } finally { ParseIOUtils.closeQuietly(fileInput); } } ParseFileHttpBody(File file);  ParseFileHttpBody(File file, String contentType); @Override InputStream getContent(); @Override void writeTo(OutputStream out); }
ParseFileHttpBody extends ParseHttpBody { @Override public void writeTo(OutputStream out) throws IOException { if (out == null) { throw new IllegalArgumentException("Output stream can not be null"); } final FileInputStream fileInput = new FileInputStream(file); try { ParseIOUtils.copy(fileInput, out); } finally { ParseIOUtils.closeQuietly(fileInput); } } ParseFileHttpBody(File file);  ParseFileHttpBody(File file, String contentType); @Override InputStream getContent(); @Override void writeTo(OutputStream out);  }