package com.atlassian.bitbucket.internal.scm.git.lfs.embedded;

import com.atlassian.bitbucket.internal.scm.git.lfs.rest.storage.HttpRange;

import javax.annotation.Nonnull;
import javax.ws.rs.core.StreamingOutput;
import java.util.Optional;

/**
 * An extension of {@link StreamingOutput} used for streaming Git LFS objects
 */
public interface ObjectStreamingOutput extends StreamingOutput {

    /**
     * @return an object encapsulating a byte range if the stream covers a specific range;
     * otherwise {@link Optional#empty()} if the stream is for the entire object
     */
    @Nonnull
    Optional<HttpRange> range();
}
