1 36 package org.columba.ristretto.message; 37 38 import java.io.InputStream ; 39 40 import org.columba.ristretto.io.CharSequenceSource; 41 import org.columba.ristretto.io.Source; 42 import org.columba.ristretto.io.SourceInputStream; 43 44 50 public class LocalMimePart extends StreamableMimePart { 51 private Source source; 52 private Source body; 53 54 59 public LocalMimePart( MimeHeader header) { 60 super(header); 61 body = new CharSequenceSource( "" ); 62 } 63 64 70 public LocalMimePart( MimeHeader header, Source body) { 71 super(header); 72 this.body = body; 73 } 74 75 78 public Source getSource() { 79 return source; 80 } 81 82 87 public void setSource(Source source) { 88 this.source = source; 89 } 90 91 96 public InputStream getInputStream() { 97 return new SourceInputStream( body.fromActualPosition() ); 98 } 99 100 103 public Source getBody() { 104 return body; 105 } 106 107 110 public void setBody(Source body) { 111 this.body = body; 112 } 113 114 115 } 116 | Popular Tags |