use of com.fastasyncworldedit.core.internal.io.FastByteArraysInputStream in project FastAsyncWorldEdit by IntellectualSites.
the class MemoryOptimizedHistory method getBlockIS.
@Override
public FaweInputStream getBlockIS() throws IOException {
if (ids == null) {
return null;
}
FaweInputStream result = MainUtil.getCompressedIS(new FastByteArraysInputStream(ids));
readHeader(result);
return result;
}
use of com.fastasyncworldedit.core.internal.io.FastByteArraysInputStream in project FastAsyncWorldEdit by IntellectualSites.
the class CompressedSchematicTag method adapt.
@Override
public LZ4BlockInputStream adapt(Clipboard src) throws IOException {
FastByteArrayOutputStream blocksOut = new FastByteArrayOutputStream();
try (LZ4BlockOutputStream lz4out = new LZ4BlockOutputStream(blocksOut)) {
NBTOutputStream nbtOut = new NBTOutputStream(lz4out);
new FastSchematicWriter(nbtOut).write(getSource());
} catch (IOException e) {
throw new RuntimeException(e);
}
FastByteArraysInputStream in = new FastByteArraysInputStream(blocksOut.toByteArrays());
return new LZ4BlockInputStream(in);
}
Aggregations