---
product: Chilkat
product_version: 11.7.0
language: vbnet
language_label: VB.NET
class: StreamConnector
license: free
deprecated: false
reference_html: https://www.chilkatsoft.com/refdoc/vbnetStreamConnectorRef.html
---
# Chilkat StreamConnector — VB.NET — v11.7.0

> Chilkat 11.7.0 · language=vbnet · class=StreamConnector
> Other versions: replace `11.7.0` in this URL. Other languages: `https://www.chilkatsoft.com/ai-docs/v/11.7.0/<lang>/classes/StreamConnector.md`.
> Language-wide rules (install, unlock, error model, strings/bytes): `https://www.chilkatsoft.com/ai-docs/v/11.7.0/vbnet/guide.md`.

## Purpose

This is a utility class that makes it possible to use System.IO.Stream objects with Chilkat.

Note: This class is not available in .NET Core or Mono.

## Object creation, unlocking and error handling

**Object Creation**

```vbnet
Dim obj As New Chilkat.StreamConnector()
```

Call `Global.UnlockBundle` once at the start of the program, before using this or any other Chilkat class. Any string unlocks a fully functional 30-day trial; a purchased unlock code is used in production. See `guide.md` for the exact code in VB.NET.

How failure is reported depends on the method's return type and is stated in the note under each method below. In every case the diagnostic text is in the `LastErrorText` property of the object whose method was called.

## Member index

| Member | Kind | Signature |
|---|---|---|
| `SetAsSink` | method | `Function SetAsSink(ByVal dnStream As System.IO.Stream, ByVal strm As Stream) As Boolean` |
| `SetAsSource` | method | `Function SetAsSource(ByVal dnStream As System.IO.Stream, ByVal strm As Stream) As Boolean` |

## Methods

### StreamConnector.SetAsSink

`Chilkat 11.7.0 · vbnet · StreamConnector · SetAsSink · method · since 9.5.0.56`

```vbnet
Function SetAsSink(ByVal dnStream As System.IO.Stream, ByVal strm As Stream) As Boolean
```

Sets the `dnStream` to be the sink of `strm`.

Returns True for success, False for failure.

### StreamConnector.SetAsSource

`Chilkat 11.7.0 · vbnet · StreamConnector · SetAsSource · method · since 9.5.0.56`

```vbnet
Function SetAsSource(ByVal dnStream As System.IO.Stream, ByVal strm As Stream) As Boolean
```

Sets the `dnStream` to be the source of `strm`.

Returns True for success, False for failure.

## Related classes

[`Stream`](https://www.chilkatsoft.com/ai-docs/v/11.7.0/vbnet/classes/Stream.md)

