public class MimeWriter extends Object
| Modifier | Constructor and Description |
|---|---|
protected |
MimeWriter(MimeWriter dad,
OutputStream os) |
protected |
MimeWriter(OutputStream os) |
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Write the final boundary terminating the mime body.
|
static MimeWriter |
createMimeWriter(OutputStream os,
String contentType,
String... subpairs)
This creates the root mime writer to some stream.
|
MimeWriter |
createSubMime(String contenttype,
String... rest)
Create a MIME part in THIS version that is a full MIME compound document itself.
|
static String |
generateContentID()
Return a valid content ID for a MIME part.
|
protected byte[] |
getBoundary() |
protected String |
getBoundaryString() |
void |
partHeader(String name,
String value) |
void |
partStart(boolean base64,
String contenttype,
String... subpairs) |
OutputStream |
partStream()
Returns the content stream for the current part.
|
Writer |
partWriter(String encoding)
Get a writer which allows writing content to the data in the appropriate format and encoding.
|
protected void |
rawHeader(String name,
String value) |
void |
write(byte[] data) |
void |
write(byte[] data,
int off,
int len)
Write the specified data TO this writer's output.
|
void |
write(String s)
Writes a string in the current encoding.
|
protected void |
writeCRLF() |
void |
writeHeader(boolean includeboundary,
String name,
String primevalue,
String... subheaders) |
void |
writeHeader(String name,
String primevalue,
String... subheaders)
BAD CODE - this writes a boundary header where there should not be one.
|
protected void |
writeOpenBoundary()
Write a boundary segment for a 'next' part.
|
protected MimeWriter(@Nonnull OutputStream os)
protected MimeWriter(@Nonnull MimeWriter dad, @Nonnull OutputStream os)
protected byte[] getBoundary()
protected String getBoundaryString()
public void write(byte[] data,
int off,
int len)
throws IOException
data - off - len - IOExceptionpublic final void write(byte[] data)
throws IOException
IOExceptionpublic void write(String s) throws IOException
s - IOExceptionprotected void rawHeader(String name, String value) throws IOException
IOExceptionprotected void writeOpenBoundary()
throws IOException
IOExceptionprotected void writeCRLF()
throws IOException
IOExceptionpublic void close()
throws IOException
IOExceptionpublic void writeHeader(@Nonnull String name, @Nonnull String primevalue, String... subheaders) throws IOException
contenttype - trailer - IOExceptionpublic void writeHeader(boolean includeboundary,
@Nonnull
String name,
@Nonnull
String primevalue,
String... subheaders)
throws IOException
IOException@Nonnull public static String generateContentID()
@Nonnull public static MimeWriter createMimeWriter(@Nonnull OutputStream os, @Nonnull String contentType, String... subpairs) throws IOException
os - contentType - rest - IOExceptionpublic void partStart(boolean base64,
String contenttype,
String... subpairs)
throws IOException
IOExceptionpublic void partHeader(String name, String value) throws IOException
IOExceptionpublic OutputStream partStream() throws IOException
IOExceptionpublic Writer partWriter(String encoding) throws IOException
IOExceptionpublic MimeWriter createSubMime(String contenttype, String... rest) throws IOException
IOExceptionCopyright © 2017 etc.to. All rights reserved.