Linkedist Arturizer Next () to throw NoSuchElementException also when the truth is called after the nested (), the truth is coming back. / P> A freeware, believe that it is irrelevant to release while (lines.hasNext ()) {int i = 0; Do {writer.write (lines.next ()); Writer.newLine (); I ++; } While (lines hasNext () & i & lt; targetLineCount); // some more code ...}
Updates with more code Axel reported that a threading seems like a problem . / div>
public class MyClass {// only one Example This class is used in the private list & lt; String & gt; Master = new linked list & lt; String & gt; (); // This example behaves the public MyClass to tune other example members (// Source and amp; Populate Master) Public Boolean Writing Data Slot (Writer Writer, Intimate LiveCount) {// It can be written by various thread illustrators ; String & gt; line = master.Director (); while (lines.hasNext ()) {int i = 0; do {writer.write (lines.next ()); writer.newLine (); i ++; } While (lines haveNext () & amp; i & lt; targetLineCount; // something else to populate slots from different sources Code.}}}}
No comments:
Post a Comment