# Class InputStreamFixedLenProducer

java.lang.Object
com.databricks.jdbc.api.impl.volume.InputStreamFixedLenProducer

All Implemented Interfaces:
  `Closeable`, `AutoCloseable`, `org.apache.hc.core5.http.EntityDetails`, `org.apache.hc.core5.http.nio.AsyncDataProducer`, `org.apache.hc.core5.http.nio.AsyncEntityProducer`, `org.apache.hc.core5.http.nio.ResourceHolder`

public final class InputStreamFixedLenProducer extends Object implements org.apache.hc.core5.http.nio.AsyncEntityProducer, Closeable
Minimal-copy streaming producer for a single-shot PUT/POST with a known `Content-Length`. Memory footprint is a single reusable byte[] buffer; data is never duplicated once inside user-space.

## Constructor Summary

Constructors
Constructor
Description
`InputStreamFixedLenProducer(InputStream source, long contentLength)`
`InputStreamFixedLenProducer(InputStream source, long contentLength, int bufferSize)`

## Method Summary

Modifier and Type
Method
Description
`int`
`available()`
`void`
`close()`
`void`
`failed(Exception cause)`
`String`
`getContentEncoding()`
`long`
`getContentLength()`
`String`
`getContentType()`
`Set<String>`
`getTrailerNames()`
`boolean`
`isChunked()`
`boolean`
`isRepeatable()`
`void`
`produce(org.apache.hc.core5.http.nio.DataStreamChannel channel)`
Called by the reactor whenever the socket can accept more bytes.
`void`
`releaseResources()`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Constructor Details

### InputStreamFixedLenProducer

public InputStreamFixedLenProducer(InputStream source, long contentLength, int bufferSize)

Parameters:
  `source` - Input stream to upload. Caller still owns the stream until this producer is closed or an error occurs.
  `contentLength` - Total number of bytes that will be read from `source`.
  `bufferSize` - Size of the reusable transfer buffer.

### InputStreamFixedLenProducer

public InputStreamFixedLenProducer(InputStream source, long contentLength)

## Method Details

### isRepeatable

public boolean isRepeatable()

Specified by:
  `isRepeatable` in interface `org.apache.hc.core5.http.nio.AsyncEntityProducer`

### isChunked

public boolean isChunked()

Specified by:
  `isChunked` in interface `org.apache.hc.core5.http.EntityDetails`

### getContentLength

public long getContentLength()

Specified by:
  `getContentLength` in interface `org.apache.hc.core5.http.EntityDetails`

### getContentType

public String getContentType()

Specified by:
  `getContentType` in interface `org.apache.hc.core5.http.EntityDetails`

### getContentEncoding

public String getContentEncoding()

Specified by:
  `getContentEncoding` in interface `org.apache.hc.core5.http.EntityDetails`

### getTrailerNames

public Set<String> getTrailerNames()

Specified by:
  `getTrailerNames` in interface `org.apache.hc.core5.http.EntityDetails`

### available

public int available()

Specified by:
  `available` in interface `org.apache.hc.core5.http.nio.AsyncDataProducer`

### produce

public void produce(org.apache.hc.core5.http.nio.DataStreamChannel channel) throws IOException
Called by the reactor whenever the socket can accept more bytes. Handles partial writes by retaining an outbound `ByteBuffer`.

Specified by:
  `produce` in interface `org.apache.hc.core5.http.nio.AsyncDataProducer`
Throws:
  `IOException`

### failed

public void failed(Exception cause)

Specified by:
  `failed` in interface `org.apache.hc.core5.http.nio.AsyncEntityProducer`

### releaseResources

public void releaseResources()

Specified by:
  `releaseResources` in interface `org.apache.hc.core5.http.nio.ResourceHolder`

### close

public void close()

Specified by:
  `close` in interface `AutoCloseable`
Specified by:
  `close` in interface `Closeable`