Hi
I was thinking if we could implement the POP3 TOP command in the POP3Handler. 
Could we have a method in Mail like: 

        public void writeContentTo(OutputStream out, int lines) throws 
                                IOException, MessagingException {
                String line;
                BufferedReader br;
                if(message != null) {
                        br = new BufferedReader(new 
InputStreamReader(message.getInputStream()));
                        while(lines-- > 0) {
                                if((line = br.readLine()) == null)
                                        break;
                        line += "\r\n";
                        out.write(line.getBytes());
                        }
                } else {
                        messageIn.mark(Integer.MAX_VALUE);
                        br  = new BufferedReader(new
                                        InputStreamReader(messageIn));
                        while(lines-- > 0)  {
                                if((line = br.readLine()) == null)
                                        break;
                                line += "\r\n";
                                out.write(line.getBytes());
                        }
                        messageIn.reset();
                }
        }
                                
The POP3Handler could then call this method after printing out all the headers in 
parseCommand.

Im sorry for posting code, but Im still not very comfortable with diff.

Bye.
Gautam
        
-- 
There is no dark side of the moon... really... matter of fact it's all dark.
                -- Pink Floyd, "Dark Side of the Moon" !?



------------------------------------------------------------
To subscribe:        [EMAIL PROTECTED]
To unsubscribe:      [EMAIL PROTECTED]
Archives and Other:  <http://java.apache.org/>
Problems?:           [EMAIL PROTECTED]

Reply via email to