Search in sources :

Example 6 with FastByteArrayOutputStream

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;
    }
}
Also used : FastByteArrayOutputStream(com.fastasyncworldedit.core.internal.io.FastByteArrayOutputStream)

Example 7 with FastByteArrayOutputStream

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());
}
Also used : FastByteArrayOutputStream(com.fastasyncworldedit.core.internal.io.FastByteArrayOutputStream) BufferedInputStream(java.io.BufferedInputStream)

Aggregations

FastByteArrayOutputStream (com.fastasyncworldedit.core.internal.io.FastByteArrayOutputStream)7 MultiClipboardHolder (com.fastasyncworldedit.core.extent.clipboard.MultiClipboardHolder)2 IOException (java.io.IOException)2 ZipEntry (java.util.zip.ZipEntry)2 DiskOptimizedClipboard (com.fastasyncworldedit.core.extent.clipboard.DiskOptimizedClipboard)1 LazyClipboardHolder (com.fastasyncworldedit.core.extent.clipboard.LazyClipboardHolder)1 ReadOnlyClipboard (com.fastasyncworldedit.core.extent.clipboard.ReadOnlyClipboard)1 URIClipboardHolder (com.fastasyncworldedit.core.extent.clipboard.URIClipboardHolder)1 FastSchematicWriter (com.fastasyncworldedit.core.extent.clipboard.io.FastSchematicWriter)1 FastByteArraysInputStream (com.fastasyncworldedit.core.internal.io.FastByteArraysInputStream)1 FaweOutputStream (com.fastasyncworldedit.core.internal.io.FaweOutputStream)1 RunnableVal (com.fastasyncworldedit.core.util.task.RunnableVal)1 ByteSource (com.google.common.io.ByteSource)1 NBTOutputStream (com.sk89q.jnbt.NBTOutputStream)1 LocalConfiguration (com.sk89q.worldedit.LocalConfiguration)1 CommandPermissions (com.sk89q.worldedit.command.util.CommandPermissions)1 BlockArrayClipboard (com.sk89q.worldedit.extent.clipboard.BlockArrayClipboard)1 Clipboard (com.sk89q.worldedit.extent.clipboard.Clipboard)1 BuiltInClipboardFormat (com.sk89q.worldedit.extent.clipboard.io.BuiltInClipboardFormat)1 ClipboardFormat (com.sk89q.worldedit.extent.clipboard.io.ClipboardFormat)1