geronimo-mail_2.1/geronimo-mail_2.1_provider/src/main/java/org/apache/geronimo/mail/store/imap/connection/IMAPResponseStream.java [330:377]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    public void checkLiteral() throws MessagingException {
        try {
            // see if we have a literal length signature at the end.
            int length = out.getLiteralLength();

            // -1 means no literal length, so we're done reading this particular response.
            if (length == -1) {
                return;
            }

            // we need to write out the literal line break marker.
            out.write('\r');
            out.write('\n');

            // have something we're supposed to read for the literal?
            if (length > 0) {
                byte[] bytes = new byte[length];

                int offset = 0;

                // The InputStream can return less than the requested length if it needs to block.
                // This may take a couple iterations to get everything, particularly if it's long.
                while (length > 0) {
                    int read = -1;
                    try {
                        read = in.read(bytes, offset, length);
                    } catch (IOException e) {
                        throw new MessagingException("Unexpected read error on server connection", e);
                    }
                    // premature EOF we can't ignore.
                    if (read == -1) {
                        throw new MessagingException("Unexpected end of stream");
                    }
                    length -= read;
                    offset += read;
                }

                // write this out to the output stream.
                out.write(bytes);
            }
            // Now that we have the literal data, we need to read the rest of the response line (which might contain
            // additional literals).  Just recurse on the line reading logic.
            readBuffer();
        } catch (IOException e) {
            e.printStackTrace();
            // this is a byte array output stream...should never happen
        }
    }
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



geronimo-javamail_1.4/geronimo-javamail_1.4_provider/src/main/java/org/apache/geronimo/javamail/store/imap/connection/IMAPResponseStream.java [334:381]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    public void checkLiteral() throws MessagingException {
        try {
            // see if we have a literal length signature at the end.
            int length = out.getLiteralLength();

            // -1 means no literal length, so we're done reading this particular response.
            if (length == -1) {
                return;
            }

            // we need to write out the literal line break marker.
            out.write('\r');
            out.write('\n');

            // have something we're supposed to read for the literal?
            if (length > 0) {
                byte[] bytes = new byte[length];

                int offset = 0;

                // The InputStream can return less than the requested length if it needs to block.
                // This may take a couple iterations to get everything, particularly if it's long.
                while (length > 0) {
                    int read = -1;
                    try {
                        read = in.read(bytes, offset, length);
                    } catch (IOException e) {
                        throw new MessagingException("Unexpected read error on server connection", e);
                    }
                    // premature EOF we can't ignore.
                    if (read == -1) {
                        throw new MessagingException("Unexpected end of stream");
                    }
                    length -= read;
                    offset += read;
                }

                // write this out to the output stream.
                out.write(bytes);
            }
            // Now that we have the literal data, we need to read the rest of the response line (which might contain
            // additional literals).  Just recurse on the line reading logic.
            readBuffer();
        } catch (IOException e) {
            e.printStackTrace();
            // this is a byte array output stream...should never happen
        }
    }
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



geronimo-javamail_1.5/geronimo-javamail_1.5_provider/src/main/java/org/apache/geronimo/javamail/store/imap/connection/IMAPResponseStream.java [334:381]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    public void checkLiteral() throws MessagingException {
        try {
            // see if we have a literal length signature at the end.
            int length = out.getLiteralLength();

            // -1 means no literal length, so we're done reading this particular response.
            if (length == -1) {
                return;
            }

            // we need to write out the literal line break marker.
            out.write('\r');
            out.write('\n');

            // have something we're supposed to read for the literal?
            if (length > 0) {
                byte[] bytes = new byte[length];

                int offset = 0;

                // The InputStream can return less than the requested length if it needs to block.
                // This may take a couple iterations to get everything, particularly if it's long.
                while (length > 0) {
                    int read = -1;
                    try {
                        read = in.read(bytes, offset, length);
                    } catch (IOException e) {
                        throw new MessagingException("Unexpected read error on server connection", e);
                    }
                    // premature EOF we can't ignore.
                    if (read == -1) {
                        throw new MessagingException("Unexpected end of stream");
                    }
                    length -= read;
                    offset += read;
                }

                // write this out to the output stream.
                out.write(bytes);
            }
            // Now that we have the literal data, we need to read the rest of the response line (which might contain
            // additional literals).  Just recurse on the line reading logic.
            readBuffer();
        } catch (IOException e) {
            e.printStackTrace();
            // this is a byte array output stream...should never happen
        }
    }
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



geronimo-javamail_1.6/geronimo-javamail_1.6_provider/src/main/java/org/apache/geronimo/javamail/store/imap/connection/IMAPResponseStream.java [334:381]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    public void checkLiteral() throws MessagingException {
        try {
            // see if we have a literal length signature at the end.
            int length = out.getLiteralLength();

            // -1 means no literal length, so we're done reading this particular response.
            if (length == -1) {
                return;
            }

            // we need to write out the literal line break marker.
            out.write('\r');
            out.write('\n');

            // have something we're supposed to read for the literal?
            if (length > 0) {
                byte[] bytes = new byte[length];

                int offset = 0;

                // The InputStream can return less than the requested length if it needs to block.
                // This may take a couple iterations to get everything, particularly if it's long.
                while (length > 0) {
                    int read = -1;
                    try {
                        read = in.read(bytes, offset, length);
                    } catch (IOException e) {
                        throw new MessagingException("Unexpected read error on server connection", e);
                    }
                    // premature EOF we can't ignore.
                    if (read == -1) {
                        throw new MessagingException("Unexpected end of stream");
                    }
                    length -= read;
                    offset += read;
                }

                // write this out to the output stream.
                out.write(bytes);
            }
            // Now that we have the literal data, we need to read the rest of the response line (which might contain
            // additional literals).  Just recurse on the line reading logic.
            readBuffer();
        } catch (IOException e) {
            e.printStackTrace();
            // this is a byte array output stream...should never happen
        }
    }
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



