/** * Create a new instance of {@link RawHttp} using the default {@link RawHttpOptions} instance. */ public RawHttp() { this(RawHttpOptions.defaultInstance()); }
/** * Create a new instance of {@link RawHttp} using the default {@link RawHttpOptions} instance. */ public RawHttp() { this(RawHttpOptions.defaultInstance()); }
/** * Create a new {@link ChunkedBody} to encode the contents of the given stream. * <p> * The stream is read lazily, so it shouldn't be closed until this body is consumed. * * @param stream content to encode * @param contentType Content-Type of the stream contents * @param chunkLength the length of each chunk */ public ChunkedBody(InputStream stream, @Nullable String contentType, int chunkLength) { this(stream, contentType, chunkLength, defaultChunkedBodyDecoder(), new HttpMetadataParser(RawHttpOptions.defaultInstance())); }
/** * Create a new {@link ChunkedBody} to encode the contents of the given stream. * <p> * The stream is read lazily, so it shouldn't be closed until this body is consumed. * * @param stream content to encode * @param contentType Content-Type of the stream contents * @param chunkLength the length of each chunk */ public ChunkedBody(InputStream stream, @Nullable String contentType, int chunkLength) { this(stream, contentType, chunkLength, defaultChunkedBodyDecoder(), new HttpMetadataParser(RawHttpOptions.defaultInstance())); }
/** * Create a new {@link ChunkedBody} to encode the contents of the given stream. * <p> * The stream is read lazily, so it shouldn't be closed until this body is consumed. * <p> * A default chunk size of 4096 bytes is used. * * @param stream content to encode */ public ChunkedBody(InputStream stream) { this(stream, null, 4096, defaultChunkedBodyDecoder(), new HttpMetadataParser(RawHttpOptions.defaultInstance())); }
/** * Create a new {@link ChunkedBody} to encode the contents of the given stream. * <p> * The stream is read lazily, so it shouldn't be closed until this body is consumed. * <p> * A default chunk size of 4096 bytes is used. * * @param stream content to encode */ public ChunkedBody(InputStream stream) { this(stream, null, 4096, defaultChunkedBodyDecoder(), new HttpMetadataParser(RawHttpOptions.defaultInstance())); }