Methods Summary |
---|
public java.lang.String | generateBoundary()
StringBuffer sb = new StringBuffer();
sb.append("----");
for (int i = 0; i < 30; i++) {
sb.append(Integer.toString((int)(Math.random() * 35), 36));
}
return sb.toString().toUpperCase();
|
public java.lang.String | getContentType()
return mContentType;
|
public java.io.InputStream | getInputStream()
return null;
|
public java.lang.String | getPreamble()
return mPreamble;
|
public void | setPreamble(java.lang.String preamble)
this.mPreamble = preamble;
|
public void | setSubType(java.lang.String subType)
this.mSubType = subType;
mContentType = String.format("multipart/%s; boundary=\"%s\"", subType, mBoundary);
|
public void | writeTo(java.io.OutputStream out)
BufferedWriter writer = new BufferedWriter(new OutputStreamWriter(out), 1024);
if (mPreamble != null) {
writer.write(mPreamble + "\r\n");
}
for (int i = 0, count = mParts.size(); i < count; i++) {
BodyPart bodyPart = (BodyPart)mParts.get(i);
writer.write("--" + mBoundary + "\r\n");
writer.flush();
bodyPart.writeTo(out);
writer.write("\r\n");
}
writer.write("--" + mBoundary + "--\r\n");
writer.flush();
|