Adds a partially constructed field to the header. This field has not had its name or value initialized.
()
| 278 | * Adds a partially constructed field to the header. This field has not had its name or value initialized. |
| 279 | */ |
| 280 | private MimeHeaderField createHeader() { |
| 281 | if (limit > -1 && count >= limit) { |
| 282 | throw new IllegalStateException(sm.getString("headers.maxCountFail", Integer.valueOf(limit))); |
| 283 | } |
| 284 | MimeHeaderField mh; |
| 285 | int len = headers.length; |
| 286 | if (count >= len) { |
| 287 | // expand header list array |
| 288 | int newLength = count * 2; |
| 289 | if (limit > 0 && newLength > limit) { |
| 290 | newLength = limit; |
| 291 | } |
| 292 | MimeHeaderField[] tmp = new MimeHeaderField[newLength]; |
| 293 | System.arraycopy(headers, 0, tmp, 0, len); |
| 294 | headers = tmp; |
| 295 | } |
| 296 | if ((mh = headers[count]) == null) { |
| 297 | headers[count] = mh = new MimeHeaderField(); |
| 298 | } |
| 299 | count++; |
| 300 | return mh; |
| 301 | } |
| 302 | |
| 303 | /** |
| 304 | * Create a new named header , return the MessageBytes container for the new value |