use of lucee.runtime.util.IO in project Lucee by lucee.
the class Page method str.
public String str(PageContext pc, int off, int len) throws IOException, PageException {
if (staticTextLocation == null) {
PageSource ps = getPageSource();
Mapping m = ps.getMapping();
staticTextLocation = m.getClassRootDirectory();
staticTextLocation = staticTextLocation.getRealResource(ps.getJavaName() + ".txt");
}
CFMLEngine e = CFMLEngineFactory.getInstance();
IO io = e.getIOUtil();
Reader reader = io.getReader(staticTextLocation, e.getCastUtil().toCharset("UTF-8"));
char[] carr = new char[len];
try {
if (off > 0)
reader.skip(off);
reader.read(carr);
} finally {
io.closeSilent(reader);
}
// print.e(carr);
return new String(carr);
}
Aggregations