use of org.exist.xquery.value.StringValue in project exist by eXist-db.
the class ZipEntryFunctions method extractStringEntry.
private StringValue extractStringEntry(final ZipInputStream zis) throws XPathException, IOException {
final char[] buf = new char[4096];
final StringBuilder builder = new StringBuilder();
int read = -1;
try (final Reader reader = new InputStreamReader(zis, UTF_8)) {
while ((read = reader.read(buf)) > -1) {
builder.append(buf, 0, read);
}
}
return new StringValue(builder.toString());
}
Aggregations