Lines 27-32
Link Here
|
27 |
|
27 |
|
28 |
public class Util { |
28 |
public class Util { |
29 |
|
29 |
|
|
|
30 |
private static final int DEFAULT_READING_SIZE = 8192; |
30 |
public static String LINE_SEPARATOR = System.getProperty("line.separator"); //$NON-NLS-1$ |
31 |
public static String LINE_SEPARATOR = System.getProperty("line.separator"); //$NON-NLS-1$ |
31 |
public static char[] LINE_SEPARATOR_CHARS = LINE_SEPARATOR.toCharArray(); |
32 |
public static char[] LINE_SEPARATOR_CHARS = LINE_SEPARATOR.toCharArray(); |
32 |
public final static char[] SUFFIX_class = ".class".toCharArray(); //$NON-NLS-1$ |
33 |
public final static char[] SUFFIX_class = ".class".toCharArray(); //$NON-NLS-1$ |
Lines 190-196
Link Here
|
190 |
int contentsLength = 0; |
191 |
int contentsLength = 0; |
191 |
int bytesRead = -1; |
192 |
int bytesRead = -1; |
192 |
do { |
193 |
do { |
193 |
int available = stream.available(); |
194 |
int available = Math.max(stream.available(), DEFAULT_READING_SIZE); |
194 |
|
195 |
|
195 |
// resize contents if needed |
196 |
// resize contents if needed |
196 |
if (contentsLength + available > contents.length) { |
197 |
if (contentsLength + available > contents.length) { |
Lines 209-215
Link Here
|
209 |
// remember length of contents |
210 |
// remember length of contents |
210 |
contentsLength += bytesRead; |
211 |
contentsLength += bytesRead; |
211 |
} |
212 |
} |
212 |
} while (bytesRead > 0); |
213 |
} while (bytesRead >= 0); |
213 |
|
214 |
|
214 |
// resize contents if necessary |
215 |
// resize contents if necessary |
215 |
if (contentsLength < contents.length) { |
216 |
if (contentsLength < contents.length) { |
Lines 253-259
Link Here
|
253 |
int contentsLength = 0; |
254 |
int contentsLength = 0; |
254 |
int charsRead = -1; |
255 |
int charsRead = -1; |
255 |
do { |
256 |
do { |
256 |
int available = stream.available(); |
257 |
int available = Math.max(stream.available(), DEFAULT_READING_SIZE); |
257 |
|
258 |
|
258 |
// resize contents if needed |
259 |
// resize contents if needed |
259 |
if (contentsLength + available > contents.length) { |
260 |
if (contentsLength + available > contents.length) { |
Lines 272-278
Link Here
|
272 |
// remember length of contents |
273 |
// remember length of contents |
273 |
contentsLength += charsRead; |
274 |
contentsLength += charsRead; |
274 |
} |
275 |
} |
275 |
} while (charsRead > 0); |
276 |
} while (charsRead >= 0); |
276 |
|
277 |
|
277 |
// resize contents if necessary |
278 |
// resize contents if necessary |
278 |
if (contentsLength < contents.length) { |
279 |
if (contentsLength < contents.length) { |