in core/src/main/java/org/apache/james/mime4j/io/MimeBoundaryInputStream.java [63:92]
public MimeBoundaryInputStream(
final BufferedLineReaderInputStream inbuffer,
final String boundary,
final boolean strict) throws IOException {
super(inbuffer);
int bufferSize = 2 * boundary.length();
if (bufferSize < 4096) {
bufferSize = 4096;
}
inbuffer.ensureCapacity(bufferSize);
this.buffer = inbuffer;
this.eof = false;
this.limit = -1;
this.atBoundary = false;
this.boundaryLen = 0;
this.lastPart = false;
this.initialLength = -1;
this.completed = false;
this.strict = strict;
this.boundary = new byte[boundary.length() + 2];
this.boundary[0] = (byte) '-';
this.boundary[1] = (byte) '-';
for (int i = 0; i < boundary.length(); i++) {
byte ch = (byte) boundary.charAt(i);
this.boundary[i + 2] = ch;
}
fillBuffer();
}