in mailbox/store/src/main/java/org/apache/james/mailbox/store/streaming/PartContentBuilder.java [81:122]
public void to(int position) throws IOException, MimeException {
try {
if (topLevel) {
topLevel = false;
} else {
skipToStartOfInner(position);
}
for (int count = 0; count < position;) {
final EntityState state = parser.next();
switch (state) {
case T_BODY:
if (position == 1) {
count++;
}
break;
case T_START_BODYPART:
count++;
break;
case T_START_MULTIPART:
if (count > 0 && count < position) {
ignoreInnerMessage();
}
break;
case T_END_OF_STREAM:
throw new PartNotFoundException(position);
case T_END_BODYPART:
case T_END_HEADER:
case T_END_MESSAGE:
case T_END_MULTIPART:
case T_EPILOGUE:
case T_FIELD:
case T_PREAMBLE:
case T_RAW_ENTITY:
case T_START_HEADER:
case T_START_MESSAGE:
break;
}
}
} catch (IllegalStateException e) {
throw new PartNotFoundException(position, e);
}
}