use of com.fastasyncworldedit.core.internal.io.FastByteArrayOutputStream in project FastAsyncWorldEdit by IntellectualSites.
the class MemoryOptimizedHistory method getBiomeOS.
@Override
public FaweOutputStream getBiomeOS() throws IOException {
if (biomeStreamZip != null) {
return biomeStreamZip;
}
synchronized (this) {
biomeStream = new FastByteArrayOutputStream(Settings.settings().HISTORY.BUFFER_SIZE);
biomeStreamZip = getCompressedOS(biomeStream);
return biomeStreamZip;
}
}
use of com.fastasyncworldedit.core.internal.io.FastByteArrayOutputStream in project FastAsyncWorldEdit by IntellectualSites.
the class ImgurUtility method uploadImage.
public static URL uploadImage(InputStream inputStream) throws IOException {
// was used until a merge deleted all the CFI/schematics functionality TODO NOT IMPLEMENTED
inputStream = new BufferedInputStream(inputStream);
FastByteArrayOutputStream baos = new FastByteArrayOutputStream(Short.MAX_VALUE);
int i;
while ((i = inputStream.read()) != -1) {
baos.write(i);
}
baos.flush();
return uploadImage(baos.toByteArray());
}
Aggregations