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

com.marklogic.client.io.marker.StreamingContentHandle Maven / Gradle / Ivy

The newest version!
/*
 * Copyright © 2024 MarkLogic Corporation. All Rights Reserved.
 */
package com.marklogic.client.io.marker;

import com.marklogic.client.io.BaseHandle;
import com.marklogic.client.io.BytesHandle;

/**
 * A Streaming Content Handle provides an adapter for a streaming content
 * representation to make it possible to construct a bufferable content
 * representation so the content can be read multiple times for purposes
 * such as resending input when retrying after a
 * failed request.
 * @param  the handled content representation
 * @param  the serialization when reading the content
 */
public interface StreamingContentHandle extends BufferableContentHandle {
    @Override
    default BufferableContentHandle resendableHandleFor(C content) {
        return new BytesHandle(contentToBytes(content))
                .withFormat(((BaseHandle) this).getFormat());
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy