Skip to main content
Package: com.coinbase.cdp.core
Represents a file stream with associated metadata for file uploads.

Constructor Details

FileStream

Overload 1
Parameters: inputStream - InputStream Overload 2
Constructs a FileStream with the given input stream and optional metadata. Parameters: inputStream (InputStream) - The input stream of the file content. Must not be null. fileName (String) - The name of the file, or null if unknown. contentType (okhttp3.MediaType) - The MIME type of the file content, or null if unknown. Throws: [NullPointerException](https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/NullPointerException.html "class or interface in java.lang") - if inputStream is null

Method Details

getInputStream

Returns: InputStream

getFileName

Returns: String

getContentType

Returns: okhttp3.MediaType

toRequestBody

Creates a RequestBody suitable for use with OkHttp client. Returns: okhttp3.RequestBody - A RequestBody instance representing this file stream.