Search in sources :

Example 1 with FixedLengthInputStream

use of com.android.voicemail.impl.mail.FixedLengthInputStream in project android_packages_apps_Dialer by LineageOS.

the class ImapResponseParser method parseLiteral.

private ImapString parseLiteral() throws IOException, MessagingException {
    expect('{');
    final int size;
    try {
        size = Integer.parseInt(readUntil('}'));
    } catch (NumberFormatException nfe) {
        throw new MessagingException("Invalid length in literal");
    }
    if (size < 0) {
        throw new MessagingException("Invalid negative length in literal");
    }
    expect('\r');
    expect('\n');
    FixedLengthInputStream in = new FixedLengthInputStream(mIn, size);
    if (size > mLiteralKeepInMemoryThreshold) {
        return new ImapTempFileLiteral(in);
    } else {
        return new ImapMemoryLiteral(in);
    }
}
Also used : FixedLengthInputStream(com.android.voicemail.impl.mail.FixedLengthInputStream) MessagingException(com.android.voicemail.impl.mail.MessagingException)

Aggregations

FixedLengthInputStream (com.android.voicemail.impl.mail.FixedLengthInputStream)1 MessagingException (com.android.voicemail.impl.mail.MessagingException)1