75 |
|
std::string lattice; |
76 |
|
if (ppfStream->getline(buffer, bufferSize)) { |
77 |
|
StringTokenizer tokenizer1(buffer); |
78 |
– |
ident = tokenizer1.nextTokenAsInt(); |
78 |
|
|
79 |
|
if (tokenizer1.countTokens() >= 4) { |
80 |
|
junk = tokenizer1.nextTokenAsInt(); |
122 |
|
if (num % dataPerLine != 0) { |
123 |
|
|
124 |
|
} |
125 |
+ |
|
126 |
+ |
int nlinesToRead = num / dataPerLine; |
127 |
|
|
128 |
|
const int bufferSize = 65535; |
129 |
|
char buffer[bufferSize]; |
130 |
|
std::string line; |
131 |
|
int readLines = num/dataPerLine; |
132 |
|
int lineCount = 0; |
132 |
– |
while(input.getline(buffer, bufferSize) && lineCount < num){ |
133 |
|
|
134 |
+ |
while(lineCount < nlinesToRead && input.getline(buffer, bufferSize) ){ |
135 |
+ |
|
136 |
|
StringTokenizer tokenizer(buffer); |
137 |
|
if (tokenizer.countTokens() >= dataPerLine) { |
138 |
|
for (int i = 0; i < dataPerLine; ++i) { |
144 |
|
++lineCount; |
145 |
|
} |
146 |
|
|
147 |
< |
if (lineCount < num) { |
147 |
> |
if (lineCount < nlinesToRead) { |
148 |
|
|
149 |
|
} |
150 |
|
|