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

org.jsoftware.restclient.BinaryContent Maven / Gradle / Ivy

The newest version!
package org.jsoftware.restclient;

import org.jetbrains.annotations.NotNull;

import java.io.IOException;
import java.io.InputStream;
import java.util.Optional;

/**
 * Access to binary content of http response.
 * @author szalik
 */
public interface BinaryContent extends AutoCloseable {

    /**
     * @throws IOException io error occurred
     * @return binary data stream
     */
    @NotNull InputStream getStream() throws IOException;

    /**
     * @return true if stream can be opened more then one time.
     */
    boolean isRepeatable();

    /**
     * @return content length
     */
    @NotNull Optional getLength();

    /**
     * @return content type;
     */
    @NotNull Optional getContentType();

    @Override
    void close(); // override - no exceptions

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy