Class HttpClient.BodySuppliers
- java.lang.Object
-
- com.github.nosan.embedded.cassandra.commons.web.HttpClient.BodySuppliers
-
- Enclosing interface:
- HttpClient
public static final class HttpClient.BodySuppliers extends Object
Utility class for creating different body suppliers.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static IOSupplier<? extends InputStream>ofBytes(byte[] body)Creates a body supplier of the provided byte array.static IOSupplier<? extends InputStream>ofString(String body)Creates a body supplier of the provided string.static IOSupplier<? extends InputStream>ofString(String body, Charset charset)Creates a body supplier of the provided string and charset.
-
-
-
Method Detail
-
ofString
public static IOSupplier<? extends InputStream> ofString(String body)
Creates a body supplier of the provided string.- Parameters:
body- the string body- Returns:
- the supplier
-
ofString
public static IOSupplier<? extends InputStream> ofString(String body, Charset charset)
Creates a body supplier of the provided string and charset.- Parameters:
body- the string bodycharset- the charset to use- Returns:
- the supplier
-
ofBytes
public static IOSupplier<? extends InputStream> ofBytes(byte[] body)
Creates a body supplier of the provided byte array.- Parameters:
body- the byte array- Returns:
- the supplier
-
-