Added in [API level 34](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  
Also in [S Extensions 7](https://developer.android.com/sdkExtensions) Summary: [Nested Classes](https://developer.android.com/reference/android/net/http/BidirectionalStream#nestedclasses) \| [Constants](https://developer.android.com/reference/android/net/http/BidirectionalStream#constants) \| [Ctors](https://developer.android.com/reference/android/net/http/BidirectionalStream#pubctors) \| [Methods](https://developer.android.com/reference/android/net/http/BidirectionalStream#pubmethods) \| [Inherited Methods](https://developer.android.com/reference/android/net/http/BidirectionalStream#inhmethods)

# BidirectionalStream

*** ** * ** ***

` public abstract class BidirectionalStream `   
` extends https://developer.android.com/reference/java/lang/Object ` ` `

|---|---|
| [java.lang.Object](https://developer.android.com/reference/java/lang/Object) ||
| ↳ | android.net.http.BidirectionalStream |

<br />

*** ** * ** ***

Class for bidirectional sending and receiving of data over HTTP/2 or QUIC connections. Created by `https://developer.android.com/reference/android/net/http/BidirectionalStream.Builder`. Note: There are ordering restrictions on methods of `https://developer.android.com/reference/android/net/http/BidirectionalStream`; please see individual methods for description of restrictions.

## Summary

| ### Nested classes ||
|---|---|
| ` class` | `https://developer.android.com/reference/android/net/http/BidirectionalStream.Builder` Builder for `https://developer.android.com/reference/android/net/http/BidirectionalStream`s. |
| ` interface` | `https://developer.android.com/reference/android/net/http/BidirectionalStream.Callback` Callback interface used to receive callbacks from a `https://developer.android.com/reference/android/net/http/BidirectionalStream`. |

| ### Constants ||
|---|---|
| `int` | `https://developer.android.com/reference/android/net/http/BidirectionalStream#STREAM_PRIORITY_HIGHEST` Highest stream priority. |
| `int` | `https://developer.android.com/reference/android/net/http/BidirectionalStream#STREAM_PRIORITY_IDLE` Lowest stream priority. |
| `int` | `https://developer.android.com/reference/android/net/http/BidirectionalStream#STREAM_PRIORITY_LOW` Low stream priority. |
| `int` | `https://developer.android.com/reference/android/net/http/BidirectionalStream#STREAM_PRIORITY_LOWEST` Very low stream priority. |
| `int` | `https://developer.android.com/reference/android/net/http/BidirectionalStream#STREAM_PRIORITY_MEDIUM` Medium stream priority. |

| ### Public constructors ||
|---|---|
| ` https://developer.android.com/reference/android/net/http/BidirectionalStream#BidirectionalStream()() ` |

| ### Public methods ||
|---|---|
| ` abstract void` | ` https://developer.android.com/reference/android/net/http/BidirectionalStream#cancel()() ` Cancels the stream. |
| ` abstract void` | ` https://developer.android.com/reference/android/net/http/BidirectionalStream#flush()() ` Flushes pending writes. |
| ` https://developer.android.com/reference/android/net/http/FinishedRequestTimings` | ` https://developer.android.com/reference/android/net/http/BidirectionalStream#getFinishedRequestTimings()() ` Returns the detailed timing metrics for the request. |
| ` abstract https://developer.android.com/reference/android/net/http/HeaderBlock` | ` https://developer.android.com/reference/android/net/http/BidirectionalStream#getHeaders()() ` See `https://developer.android.com/reference/android/net/http/BidirectionalStream.Builder#addHeader(java.lang.String,%20java.lang.String)` |
| ` abstract https://developer.android.com/reference/java/lang/String` | ` https://developer.android.com/reference/android/net/http/BidirectionalStream#getHttpMethod()() ` See `https://developer.android.com/reference/android/net/http/BidirectionalStream.Builder#setHttpMethod(java.lang.String)`. |
| ` abstract int` | ` https://developer.android.com/reference/android/net/http/BidirectionalStream#getPriority()() ` See `https://developer.android.com/reference/android/net/http/BidirectionalStream.Builder#setPriority(int)` |
| ` abstract int` | ` https://developer.android.com/reference/android/net/http/BidirectionalStream#getTrafficStatsTag()() ` See `https://developer.android.com/reference/android/net/http/BidirectionalStream.Builder#setTrafficStatsTag(int)` |
| ` abstract int` | ` https://developer.android.com/reference/android/net/http/BidirectionalStream#getTrafficStatsUid()() ` See `https://developer.android.com/reference/android/net/http/BidirectionalStream.Builder#setTrafficStatsUid(int)` |
| ` abstract boolean` | ` https://developer.android.com/reference/android/net/http/BidirectionalStream#hasTrafficStatsTag()() ` See `https://developer.android.com/reference/android/net/http/BidirectionalStream.Builder#setTrafficStatsTag(int)` |
| ` abstract boolean` | ` https://developer.android.com/reference/android/net/http/BidirectionalStream#hasTrafficStatsUid()() ` See `https://developer.android.com/reference/android/net/http/BidirectionalStream.Builder#setTrafficStatsUid(int)` |
| ` abstract boolean` | ` https://developer.android.com/reference/android/net/http/BidirectionalStream#isDelayRequestHeadersUntilFirstFlushEnabled()() ` See `https://developer.android.com/reference/android/net/http/BidirectionalStream.Builder#setDelayRequestHeadersUntilFirstFlushEnabled(boolean)` |
| ` abstract boolean` | ` https://developer.android.com/reference/android/net/http/BidirectionalStream#isDone()() ` Returns `true` if the stream was successfully started and is now done (succeeded, canceled, or failed). |
| ` abstract void` | ` https://developer.android.com/reference/android/net/http/BidirectionalStream#read(java.nio.ByteBuffer)(https://developer.android.com/reference/java/nio/ByteBuffer buffer) ` Reads data from the stream into the provided buffer. |
| ` abstract void` | ` https://developer.android.com/reference/android/net/http/BidirectionalStream#start()() ` Starts the stream, all callbacks go to the `callback` argument passed to `https://developer.android.com/reference/android/net/http/BidirectionalStream.Builder`'s constructor. |
| ` abstract void` | ` https://developer.android.com/reference/android/net/http/BidirectionalStream#write(java.nio.ByteBuffer,%20boolean)(https://developer.android.com/reference/java/nio/ByteBuffer buffer, boolean endOfStream) ` Attempts to write data from the provided buffer into the stream. |

### Inherited methods

From class ` https://developer.android.com/reference/java/lang/Object ` ` https://developer.android.com/reference/java/lang/Object` ` https://developer.android.com/reference/java/lang/Object#clone()() `

Creates and returns a copy of this object.
` boolean` ` https://developer.android.com/reference/java/lang/Object#equals(java.lang.Object)(https://developer.android.com/reference/java/lang/Object obj) `

Indicates whether some other object is "equal to" this one.
` void` ` https://developer.android.com/reference/java/lang/Object#finalize()() `

Called by the garbage collector on an object when garbage collection determines that there are no more references to the object.
` final https://developer.android.com/reference/java/lang/Class<?>` ` https://developer.android.com/reference/java/lang/Object#getClass()() `

Returns the runtime class of this `Object`.
` int` ` https://developer.android.com/reference/java/lang/Object#hashCode()() `

Returns a hash code value for the object.
` final void` ` https://developer.android.com/reference/java/lang/Object#notify()() `

Wakes up a single thread that is waiting on this object's monitor.
` final void` ` https://developer.android.com/reference/java/lang/Object#notifyAll()() `

Wakes up all threads that are waiting on this object's monitor.
` https://developer.android.com/reference/java/lang/String` ` https://developer.android.com/reference/java/lang/Object#toString()() `

Returns a string representation of the object.
` final void` ` https://developer.android.com/reference/java/lang/Object#wait(long,%20int)(long timeoutMillis, int nanos) `

Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*, or until a certain amount of real time has elapsed.
` final void` ` https://developer.android.com/reference/java/lang/Object#wait(long)(long timeoutMillis) `

Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*, or until a certain amount of real time has elapsed.
` final void` ` https://developer.android.com/reference/java/lang/Object#wait()() `

Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*.

## Constants

### STREAM_PRIORITY_HIGHEST

Added in [API level 34](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  
Also in [S Extensions 7](https://developer.android.com/sdkExtensions)

```
public static final int STREAM_PRIORITY_HIGHEST
```

Highest stream priority. Passed to `https://developer.android.com/reference/android/net/http/BidirectionalStream.Builder#setPriority(int)`.

<br />

Constant Value: 4 (0x00000004)

### STREAM_PRIORITY_IDLE

Added in [API level 34](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  
Also in [S Extensions 7](https://developer.android.com/sdkExtensions)

```
public static final int STREAM_PRIORITY_IDLE
```

Lowest stream priority. Passed to `https://developer.android.com/reference/android/net/http/BidirectionalStream.Builder#setPriority(int)`.

<br />

Constant Value: 0 (0x00000000)

### STREAM_PRIORITY_LOW

Added in [API level 34](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  
Also in [S Extensions 7](https://developer.android.com/sdkExtensions)

```
public static final int STREAM_PRIORITY_LOW
```

Low stream priority. Passed to `https://developer.android.com/reference/android/net/http/BidirectionalStream.Builder#setPriority(int)`.

<br />

Constant Value: 2 (0x00000002)

### STREAM_PRIORITY_LOWEST

Added in [API level 34](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  
Also in [S Extensions 7](https://developer.android.com/sdkExtensions)

```
public static final int STREAM_PRIORITY_LOWEST
```

Very low stream priority. Passed to `https://developer.android.com/reference/android/net/http/BidirectionalStream.Builder#setPriority(int)`.

<br />

Constant Value: 1 (0x00000001)

### STREAM_PRIORITY_MEDIUM

Added in [API level 34](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  
Also in [S Extensions 7](https://developer.android.com/sdkExtensions)

```
public static final int STREAM_PRIORITY_MEDIUM
```

Medium stream priority. Passed to `https://developer.android.com/reference/android/net/http/BidirectionalStream.Builder#setPriority(int)`. This is the default priority given to the stream.

<br />

Constant Value: 3 (0x00000003)

## Public constructors

### BidirectionalStream

Added in [API level 34](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  
Also in [S Extensions 7](https://developer.android.com/sdkExtensions)

```
public BidirectionalStream ()
```

<br />

<br />

## Public methods

### cancel

Added in [API level 34](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  
Also in [S Extensions 7](https://developer.android.com/sdkExtensions)

```
public abstract void cancel ()
```

Cancels the stream. Can be called at any time after `https://developer.android.com/reference/android/net/http/BidirectionalStream#start()`. `https://developer.android.com/reference/android/net/http/BidirectionalStream.Callback#onCanceled(android.net.http.BidirectionalStream,%20android.net.http.UrlResponseInfo)` will be invoked when cancelation is complete and no further callback methods will be invoked. If the stream has completed or has not started, calling `cancel()` has no effect and `onCanceled()` will not be invoked. If the `https://developer.android.com/reference/java/util/concurrent/Executor` passed in during `BidirectionalStream` construction runs tasks on a single thread, and `cancel()` is called on that thread, no listener methods (besides `onCanceled()`) will be invoked after `cancel()` is called. Otherwise, at most one callback method may be invoked after `cancel()` has completed.

<br />

### flush

Added in [API level 34](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  
Also in [S Extensions 7](https://developer.android.com/sdkExtensions)

```
public abstract void flush ()
```

Flushes pending writes. This method should not be invoked before `https://developer.android.com/reference/android/net/http/BidirectionalStream.Callback#onStreamReady(android.net.http.BidirectionalStream)`. For previously delayed `https://developer.android.com/reference/android/net/http/BidirectionalStream#write(java.nio.ByteBuffer,%20boolean)`s, a corresponding `https://developer.android.com/reference/android/net/http/BidirectionalStream.Callback#onWriteCompleted(android.net.http.BidirectionalStream,%20android.net.http.UrlResponseInfo,%20java.nio.ByteBuffer,%20boolean)` will be invoked when the buffer is sent.

<br />

### getFinishedRequestTimings

Added in [version 37.1](https://developer.android.com/topic/libraries/support-library/revisions)  
Also in [S Extensions 23](https://developer.android.com/sdkExtensions)

```
public FinishedRequestTimings getFinishedRequestTimings ()
```

Returns the detailed timing metrics for the request.

This method can be only called when the request has reached a terminal callback. This is defined by the execution of one of the following callbacks: `https://developer.android.com/reference/android/net/http/BidirectionalStream.Callback#onSucceeded(android.net.http.BidirectionalStream,%20android.net.http.UrlResponseInfo)`, `https://developer.android.com/reference/android/net/http/BidirectionalStream.Callback#onFailed(android.net.http.BidirectionalStream,%20android.net.http.UrlResponseInfo,%20android.net.http.HttpException)` or `https://developer.android.com/reference/android/net/http/BidirectionalStream.Callback#onCanceled(android.net.http.BidirectionalStream,%20android.net.http.UrlResponseInfo)`. It's also allowed to call this method in the terminal callback itself.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/net/http/FinishedRequestTimings` | This value cannot be `null`. <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/java/lang/IllegalStateException` | If called before the terminal callback is called. |

### getHeaders

Added in [API level 34](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  
Also in [S Extensions 7](https://developer.android.com/sdkExtensions)

```
public abstract HeaderBlock getHeaders ()
```

See `https://developer.android.com/reference/android/net/http/BidirectionalStream.Builder#addHeader(java.lang.String,%20java.lang.String)`

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/net/http/HeaderBlock` | This value cannot be `null`. <br /> |

### getHttpMethod

Added in [API level 34](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  
Also in [S Extensions 7](https://developer.android.com/sdkExtensions)

```
public abstract String getHttpMethod ()
```

See `https://developer.android.com/reference/android/net/http/BidirectionalStream.Builder#setHttpMethod(java.lang.String)`.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/lang/String` | This value cannot be `null`. <br /> |

### getPriority

Added in [API level 34](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  
Also in [S Extensions 7](https://developer.android.com/sdkExtensions)

```
public abstract int getPriority ()
```

See `https://developer.android.com/reference/android/net/http/BidirectionalStream.Builder#setPriority(int)`

<br />

| Returns ||
|---|---|
| `int` | Value is one of the following: - `https://developer.android.com/reference/android/net/http/BidirectionalStream#STREAM_PRIORITY_IDLE` - `https://developer.android.com/reference/android/net/http/BidirectionalStream#STREAM_PRIORITY_LOWEST` - `https://developer.android.com/reference/android/net/http/BidirectionalStream#STREAM_PRIORITY_LOW` - `https://developer.android.com/reference/android/net/http/BidirectionalStream#STREAM_PRIORITY_MEDIUM` - `https://developer.android.com/reference/android/net/http/BidirectionalStream#STREAM_PRIORITY_HIGHEST` |

### getTrafficStatsTag

Added in [API level 34](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  
Also in [S Extensions 7](https://developer.android.com/sdkExtensions)

```
public abstract int getTrafficStatsTag ()
```

See `https://developer.android.com/reference/android/net/http/BidirectionalStream.Builder#setTrafficStatsTag(int)`

<br />

| Returns ||
|---|---|
| `int` | <br /> |

### getTrafficStatsUid

Added in [API level 34](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  
Also in [S Extensions 7](https://developer.android.com/sdkExtensions)

```
public abstract int getTrafficStatsUid ()
```

See `https://developer.android.com/reference/android/net/http/BidirectionalStream.Builder#setTrafficStatsUid(int)`

<br />

| Returns ||
|---|---|
| `int` | <br /> |

### hasTrafficStatsTag

Added in [API level 34](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  
Also in [S Extensions 7](https://developer.android.com/sdkExtensions)

```
public abstract boolean hasTrafficStatsTag ()
```

See `https://developer.android.com/reference/android/net/http/BidirectionalStream.Builder#setTrafficStatsTag(int)`

<br />

| Returns ||
|---|---|
| `boolean` | <br /> |

### hasTrafficStatsUid

Added in [API level 34](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  
Also in [S Extensions 7](https://developer.android.com/sdkExtensions)

```
public abstract boolean hasTrafficStatsUid ()
```

See `https://developer.android.com/reference/android/net/http/BidirectionalStream.Builder#setTrafficStatsUid(int)`

<br />

| Returns ||
|---|---|
| `boolean` | <br /> |

### isDelayRequestHeadersUntilFirstFlushEnabled

Added in [API level 34](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  
Also in [S Extensions 7](https://developer.android.com/sdkExtensions)

```
public abstract boolean isDelayRequestHeadersUntilFirstFlushEnabled ()
```

See `https://developer.android.com/reference/android/net/http/BidirectionalStream.Builder#setDelayRequestHeadersUntilFirstFlushEnabled(boolean)`

<br />

| Returns ||
|---|---|
| `boolean` | <br /> |

### isDone

Added in [API level 34](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  
Also in [S Extensions 7](https://developer.android.com/sdkExtensions)

```
public abstract boolean isDone ()
```

Returns `true` if the stream was successfully started and is now done (succeeded, canceled, or failed).

<br />

| Returns ||
|---|---|
| `boolean` | `true` if the stream was successfully started and is now done (completed, canceled, or failed), otherwise returns `false` to indicate stream is not yet started or is in progress. <br /> |

### read

Added in [API level 34](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  
Also in [S Extensions 7](https://developer.android.com/sdkExtensions)

```
public abstract void read (ByteBuffer buffer)
```

Reads data from the stream into the provided buffer. Can only be called at most once in response to each invocation of the `https://developer.android.com/reference/android/net/http/BidirectionalStream.Callback#onStreamReady(android.net.http.BidirectionalStream)`/ `https://developer.android.com/reference/android/net/http/BidirectionalStream.Callback#onResponseHeadersReceived(android.net.http.BidirectionalStream,%20android.net.http.UrlResponseInfo)` and `https://developer.android.com/reference/android/net/http/BidirectionalStream.Callback#onReadCompleted(android.net.http.BidirectionalStream,%20android.net.http.UrlResponseInfo,%20java.nio.ByteBuffer,%20boolean)` methods of the `https://developer.android.com/reference/android/net/http/BidirectionalStream.Callback`. Each call will result in an invocation of one of the `https://developer.android.com/reference/android/net/http/BidirectionalStream.Callback`'s `https://developer.android.com/reference/android/net/http/BidirectionalStream.Callback#onReadCompleted(android.net.http.BidirectionalStream,%20android.net.http.UrlResponseInfo,%20java.nio.ByteBuffer,%20boolean)` method if data is read, or its `https://developer.android.com/reference/android/net/http/BidirectionalStream.Callback#onFailed(android.net.http.BidirectionalStream,%20android.net.http.UrlResponseInfo,%20android.net.http.HttpException)` method if there's an error. An attempt to read data into `buffer` starting at `buffer.position()` is begun. At most `buffer.remaining()` bytes are read. `buffer.position()` is updated upon invocation of `https://developer.android.com/reference/android/net/http/BidirectionalStream.Callback#onReadCompleted(android.net.http.BidirectionalStream,%20android.net.http.UrlResponseInfo,%20java.nio.ByteBuffer,%20boolean)` to indicate how much data was read.

<br />

| Parameters ||
|---|---|
| `buffer` | `ByteBuffer`: the `https://developer.android.com/reference/java/nio/ByteBuffer` to read data into. Must be a direct ByteBuffer. The embedder must not read or modify buffer's position, limit, or data between its position and limit until `https://developer.android.com/reference/android/net/http/BidirectionalStream.Callback#onReadCompleted(android.net.http.BidirectionalStream,%20android.net.http.UrlResponseInfo,%20java.nio.ByteBuffer,%20boolean)`, `https://developer.android.com/reference/android/net/http/BidirectionalStream.Callback#onCanceled(android.net.http.BidirectionalStream,%20android.net.http.UrlResponseInfo)`, or `https://developer.android.com/reference/android/net/http/BidirectionalStream.Callback#onFailed(android.net.http.BidirectionalStream,%20android.net.http.UrlResponseInfo,%20android.net.http.HttpException)` are invoked. This value cannot be `null`. <br /> |

### start

Added in [API level 34](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  
Also in [S Extensions 7](https://developer.android.com/sdkExtensions)

```
public abstract void start ()
```

Starts the stream, all callbacks go to the `callback` argument passed to `https://developer.android.com/reference/android/net/http/BidirectionalStream.Builder`'s constructor. Should only be called once.

<br />

### write

Added in [API level 34](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  
Also in [S Extensions 7](https://developer.android.com/sdkExtensions)

```
public abstract void write (ByteBuffer buffer, 
                boolean endOfStream)
```

Attempts to write data from the provided buffer into the stream. If auto flush is disabled, data will be sent only after `https://developer.android.com/reference/android/net/http/BidirectionalStream#flush()` is called. Each call will result in an invocation of one of the `https://developer.android.com/reference/android/net/http/BidirectionalStream.Callback`'s `https://developer.android.com/reference/android/net/http/BidirectionalStream.Callback#onWriteCompleted(android.net.http.BidirectionalStream,%20android.net.http.UrlResponseInfo,%20java.nio.ByteBuffer,%20boolean)` method if data is sent, or its `https://developer.android.com/reference/android/net/http/BidirectionalStream.Callback#onFailed(android.net.http.BidirectionalStream,%20android.net.http.UrlResponseInfo,%20android.net.http.HttpException)` method if there's an error. An attempt to write data from `buffer` starting at `buffer.position()` is begun. `buffer.remaining()` bytes will be written. `https://developer.android.com/reference/android/net/http/BidirectionalStream.Callback#onWriteCompleted(android.net.http.BidirectionalStream,%20android.net.http.UrlResponseInfo,%20java.nio.ByteBuffer,%20boolean)` will be invoked only when the full ByteBuffer is written.

<br />

| Parameters ||
|---|---|
| `buffer` | `ByteBuffer`: the `https://developer.android.com/reference/java/nio/ByteBuffer` to write data from. Must be a direct ByteBuffer. The embedder must not read or modify buffer's position, limit, or data between its position and limit until `https://developer.android.com/reference/android/net/http/BidirectionalStream.Callback#onWriteCompleted(android.net.http.BidirectionalStream,%20android.net.http.UrlResponseInfo,%20java.nio.ByteBuffer,%20boolean)`, `https://developer.android.com/reference/android/net/http/BidirectionalStream.Callback#onCanceled(android.net.http.BidirectionalStream,%20android.net.http.UrlResponseInfo)`, or `https://developer.android.com/reference/android/net/http/BidirectionalStream.Callback#onFailed(android.net.http.BidirectionalStream,%20android.net.http.UrlResponseInfo,%20android.net.http.HttpException)` are invoked. Can be empty when `endOfStream` is `true`. This value cannot be `null`. <br /> |
| `endOfStream` | `boolean`: if `true`, then `buffer` is the last buffer to be written, and once written, stream is closed from the client side, resulting in half-closed stream or a fully closed stream if the remote side has already closed. <br /> |