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

net.dongliu.requests.body.BytesRequestBody Maven / Gradle / Ivy

There is a newer version: 5.0.8
Show newest version
package net.dongliu.requests.body;

import java.io.IOException;
import java.io.OutputStream;
import java.nio.charset.Charset;

import static net.dongliu.requests.HttpHeaders.CONTENT_TYPE_BINARY;

/**
 * @author Liu Dong
 */
class BytesRequestBody extends RequestBody {
    BytesRequestBody(byte[] body) {
        super(body, CONTENT_TYPE_BINARY, false);
    }

    @Override public void writeBody(OutputStream os, Charset charset) throws IOException {
        os.write(getBody());
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy