|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.james.mime4j.dom.SingleBody
public abstract class SingleBody
Abstract implementation of a single message body; that is, a body that does not contain (directly or indirectly) any other child bodies. It also provides the parent functionality required by bodies.
| Constructor Summary | |
|---|---|
protected |
SingleBody()
Sole constructor. |
| Method Summary | |
|---|---|
SingleBody |
copy()
Returns a copy of this SingleBody (optional operation). |
void |
dispose()
Subclasses should override this method if they have allocated resources that need to be freed explicitly (e.g. cannot be simply reclaimed by the garbage collector). |
abstract InputStream |
getInputStream()
Gets a InputStream which reads the bytes of the body. |
Entity |
getParent()
Gets the parent of this body. |
void |
setParent(Entity parent)
Sets the parent of this body. |
void |
writeTo(OutputStream out)
Writes this single body to the given stream. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
protected SingleBody()
| Method Detail |
|---|
public Entity getParent()
Body
getParent in interface BodyBody.getParent()public void setParent(Entity parent)
Body
setParent in interface Bodyparent - the parent.Body.setParent(org.apache.james.mime4j.dom.Entity)
public abstract InputStream getInputStream()
throws IOException
InputStream which reads the bytes of the body.
IOException - on I/O errors.
public void writeTo(OutputStream out)
throws IOException
getInputStream() to the specified output
stream. May be overwritten by a subclass to improve performance.
out - the stream to write to.
IOException - in case of an I/O errorpublic SingleBody copy()
SingleBody (optional operation).
The general contract of this method is as follows:
getParent() on the copy returns null.
That means that the copy is detached from the parent entity of this
SingleBody. The copy may get attached to a different
entity later on.SingleBody.
This implementation always throws an
UnsupportedOperationException.
SingleBody.
UnsupportedOperationException - if the copy operation is not supported by this
single body.public void dispose()
dispose in interface DisposableDisposable.dispose()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||