# Sandbox.Internal.SafeEncoder.GetBytes

## Overload 1

```csharp
int GetBytes(char[] chars, int charIndex, int charCount, byte[] bytes, int byteIndex, bool flush)
```

### Parameters

- `chars` (`char[]`)
- `charIndex` (`int`)
- `charCount` (`int`)
- `bytes` (`byte[]`)
- `byteIndex` (`int`)
- `flush` (`bool`)

### Returns

`int`

## Overload 2

```csharp
int GetBytes(char* chars, int charCount, byte* bytes, int byteCount, bool flush)
```

### Parameters

- `chars` (`char*`)
- `charCount` (`int`)
- `bytes` (`byte*`)
- `byteCount` (`int`)
- `flush` (`bool`)

### Returns

`int`

## Overload 3

```csharp
int GetBytes(System.ReadOnlySpan<char> chars, System.Span<byte> bytes, bool flush)
```

### Parameters

- `chars` (`System.ReadOnlySpan<char>`)
- `bytes` (`System.Span<byte>`)
- `flush` (`bool`)

### Returns

`int`

Declared in [Sandbox.Internal.SafeEncoder](/api/Sandbox.Internal.SafeEncoder).
Assembly: `Sandbox.System`.
