mirror of
https://github.com/sigmasternchen/xtext-core
synced 2025-03-16 16:58:56 +00:00
[resource / file system access] use BufferedInputStream
Change-Id: I5024e7dd439f09daf85c82aba2c8a58879b9d14e
This commit is contained in:
parent
48aedfcf0a
commit
38bbe3ddb1
2 changed files with 4 additions and 2 deletions
|
@ -7,6 +7,7 @@
|
|||
*******************************************************************************/
|
||||
package org.eclipse.xtext.generator;
|
||||
|
||||
import java.io.BufferedInputStream;
|
||||
import java.io.BufferedOutputStream;
|
||||
import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
|
@ -213,7 +214,7 @@ public class JavaIoFileSystemAccess extends AbstractFileSystemAccess2 {
|
|||
public InputStream readBinaryFile(String fileName, String outputCfgName) throws RuntimeIOException {
|
||||
File file = getFile(fileName, outputCfgName);
|
||||
try {
|
||||
return new FileInputStream(file);
|
||||
return new BufferedInputStream(new FileInputStream(file));
|
||||
} catch (FileNotFoundException e) {
|
||||
throw new RuntimeIOException(e);
|
||||
}
|
||||
|
|
|
@ -8,6 +8,7 @@
|
|||
*******************************************************************************/
|
||||
package org.eclipse.xtext.resource;
|
||||
|
||||
import java.io.BufferedInputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.InputStreamReader;
|
||||
|
@ -177,7 +178,7 @@ public class XtextResource extends ResourceImpl {
|
|||
if (inputStream instanceof LazyStringInputStream) {
|
||||
return new StringReader(((LazyStringInputStream) inputStream).getString());
|
||||
}
|
||||
return new InputStreamReader(inputStream, getEncoding());
|
||||
return new InputStreamReader(new BufferedInputStream(inputStream), getEncoding());
|
||||
}
|
||||
|
||||
protected void setEncodingFromOptions(Map<?, ?> options) {
|
||||
|
|
Loading…
Reference in a new issue