// 属性组 private MimeHeaderField[] headers = new MimeHeaderField[8];
/** * Allow "set" operations, which removes all current values * for this header. * @param name The header name * @return the message bytes container for the value */ public MessageBytes setValue(String name){ for(int i = 0; i < this.count; ++i) { if (this.headers[i].getName().equalsIgnoreCase(name)) { for(int j = i + 1; j < this.count; ++j) { if (this.headers[j].getName().equalsIgnoreCase(name)) { this.removeHeader(j--); } } returnthis.headers[i].getValue(); } } MimeHeaderField mh = this.createHeader(); mh.getName().setString(name); return mh.getValue(); }