/** * @param inStream input stream * @param length of the input stream, {@code -1} if unknown * @param contentType for specifying the {@code Content-Type} header, may be {@code null} * @throws IllegalArgumentException if {@code inStream} is {@code null} * @since 4.2 */ public InputStreamEntity(final InputStream inStream, final long length, final ContentType contentType) { super(); this.content = Args.notNull(inStream, "Source input stream"); this.length = length; if (contentType != null) { setContentType(contentType.toString()); } }
/** * @param inStream input stream * @param length of the input stream, {@code -1} if unknown * @param contentType for specifying the {@code Content-Type} header, may be {@code null} * @throws IllegalArgumentException if {@code inStream} is {@code null} * @since 4.2 */ public InputStreamEntity(final InputStream inStream, final long length, final ContentType contentType) { super(); this.content = Args.notNull(inStream, "Source input stream"); this.length = length; if (contentType != null) { setContentType(contentType.toString()); } }