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

com.bluenimble.platform.api.impls.readers.StreamApiRequestBodyReader Maven / Gradle / Ivy

There is a newer version: 2.50.0
Show newest version
package com.bluenimble.platform.api.impls.readers;

import java.io.IOException;
import java.io.InputStream;

import com.bluenimble.platform.api.ApiContentTypes;
import com.bluenimble.platform.api.ApiRequest;
import com.bluenimble.platform.api.ApiRequestBodyReader;
import com.bluenimble.platform.api.impls.DefaultApiStreamSource;

public class StreamApiRequestBodyReader implements ApiRequestBodyReader {

	private static final long serialVersionUID = -9161966870378744014L;

	@Override
	public Object read (InputStream payload, String contentType, long length) throws IOException {
		return new DefaultApiStreamSource (ApiRequest.Payload, ApiRequest.Payload, contentType, length, payload).setClosable (true);
	}

	@Override
	public String [] mediaTypes () {
		return new String [] { ApiContentTypes.Stream };
	}

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy