/[classpath]/inetlib/source/gnu/inet/nntp/HeaderIterator.java
ViewVC logotype

Diff of /inetlib/source/gnu/inet/nntp/HeaderIterator.java

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.6 by dog, Thu Nov 25 22:15:05 2004 UTC revision 1.7 by dog, Thu Aug 25 09:45:14 2005 UTC
# Line 39  Line 39 
39  package gnu.inet.nntp;  package gnu.inet.nntp;
40    
41  import java.io.IOException;  import java.io.IOException;
42    import java.net.ProtocolException;
43  import java.util.NoSuchElementException;  import java.util.NoSuchElementException;
44    
45  /**  /**
# Line 78  public class HeaderIterator Line 79  public class HeaderIterator
79    {    {
80      String line = nextLine();      String line = nextLine();
81    
82      // Parse line      try
83      int start = 0, end;        {
84      end = line.indexOf(' ', start);          // Parse line
85      String articleId = line.substring(start, end);          int start = 0, end;
86      start = end + 1;          end = line.indexOf(' ', start);
87      String header = line.substring(start);          String articleId = line.substring(start, end);
88            start = end + 1;
89      return new HeaderEntry(articleId, header);          String header = line.substring(start);
90            
91            return new HeaderEntry(articleId, header);
92          }
93        catch (StringIndexOutOfBoundsException e)
94          {
95            ProtocolException e2 =
96              new ProtocolException("Invalid header line: " + line);
97            e2.initCause(e);
98            throw e2;
99          }
100    }    }
101    
102  }  }

Legend:
Removed from v.1.6  
changed lines
  Added in v.1.7

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26