All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.airlift.airship.coordinator.InputSupplierStreamingOutput Maven / Gradle / Ivy

The newest version!
package io.airlift.airship.coordinator;

import com.google.common.io.ByteStreams;
import com.google.common.io.InputSupplier;

import javax.ws.rs.WebApplicationException;
import javax.ws.rs.core.StreamingOutput;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;

class InputSupplierStreamingOutput implements StreamingOutput
{
    private final InputSupplier inputSupplier;

    public InputSupplierStreamingOutput(InputSupplier inputSupplier)
    {
        this.inputSupplier = inputSupplier;
    }

    public void write(OutputStream output)
            throws IOException, WebApplicationException
    {
        ByteStreams.copy(inputSupplier, output);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy