fix resource loading
This commit is contained in:
parent
511ba3dbe6
commit
fd83813ecf
1 changed files with 18 additions and 16 deletions
|
@ -148,13 +148,14 @@ public class BrowserContext {
|
||||||
return builder.toString();
|
return builder.toString();
|
||||||
}
|
}
|
||||||
stream = new FileInputStream(file);
|
stream = new FileInputStream(file);
|
||||||
int i = 0;
|
|
||||||
while((i = stream.read()) != -1) {
|
|
||||||
builder.append((char) i);
|
|
||||||
}
|
|
||||||
|
|
||||||
stream.close();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int i = 0;
|
||||||
|
while((i = stream.read()) != -1) {
|
||||||
|
builder.append((char) i);
|
||||||
|
}
|
||||||
|
|
||||||
|
stream.close();
|
||||||
|
|
||||||
if(!TryConfig.nocache)
|
if(!TryConfig.nocache)
|
||||||
cache.put(file, builder.toString());
|
cache.put(file, builder.toString());
|
||||||
|
@ -183,17 +184,18 @@ public class BrowserContext {
|
||||||
return builder.toString();
|
return builder.toString();
|
||||||
}
|
}
|
||||||
stream = new FileInputStream(file);
|
stream = new FileInputStream(file);
|
||||||
ByteArrayOutputStream s = new ByteArrayOutputStream();
|
|
||||||
|
|
||||||
int i = 0;
|
|
||||||
while((i = stream.read()) != -1) {
|
|
||||||
s.write(i);
|
|
||||||
}
|
|
||||||
|
|
||||||
stream.close();
|
|
||||||
s.close();
|
|
||||||
st = new String(s.toByteArray());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ByteArrayOutputStream s = new ByteArrayOutputStream();
|
||||||
|
|
||||||
|
int i = 0;
|
||||||
|
while((i = stream.read()) != -1) {
|
||||||
|
s.write(i);
|
||||||
|
}
|
||||||
|
|
||||||
|
stream.close();
|
||||||
|
s.close();
|
||||||
|
st = new String(s.toByteArray());
|
||||||
if(!TryConfig.nocache)
|
if(!TryConfig.nocache)
|
||||||
cache.put(file, st);
|
cache.put(file, st);
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue