Class ByteArrayBody
-
- All Implemented Interfaces:
public final class ByteArrayBody extends RequestBody
Represents a request body backed by in-memory bytes.
-
-
Constructor Summary
Constructors Constructor Description ByteArrayBody(ByteArray bytes, Integer encoding)
-
Method Summary
Modifier and Type Method Description UnitwriteToStream(BufferedSink bufferedSink)Writes the request body to the provided BufferedSink. StringgetContentType()Retrieves the content type of the request body. BufferedSourcegetSource()Retrieves the source of the request body. -
-
Method Detail
-
writeToStream
Unit writeToStream(BufferedSink bufferedSink)
Writes the request body to the provided BufferedSink.
- Parameters:
bufferedSink- The sink to write the request body to.
-
getContentType
String getContentType()
Retrieves the content type of the request body.
- Returns:
The content type.
-
getSource
BufferedSource getSource()
Retrieves the source of the request body.
- Returns:
The source.
-
-
-
-