public InputStream getContent() throws IOException, IllegalStateException { if (!isRepeatable() && this.contentConsumed) { throw new IllegalStateException("Content has been consumed"); } this.contentConsumed = true; ByteArrayOutputStream baos = new ByteArrayOutputStream(); Part.sendParts(baos, this.parts, this.multipartBoundary); ByteArrayInputStream bais = new ByteArrayInputStream(baos.toByteArray()); return bais; }
/* (non-Javadoc) */ public void writeTo(OutputStream out) throws IOException { // if (out != null) { // android.util.Log.v("multipartEntity", "out != null"); // } Part.sendParts(out, parts, getMultipartBoundary()); }