Class ByteExtensions
Bytes 扩展方法
Inherited Members
Namespace: Lett.Extensions
Assembly: Lett.Extensions.dll
Syntax
public static class ByteExtensions
Methods
| Improve this Doc View SourceEncodeToString(Byte[])
转换为字符串
默认Encoding.UTF8
Declaration
public static string EncodeToString(this byte[] this)
Parameters
| Type | Name | Description |
|---|---|---|
| Byte[] | this |
Returns
| Type | Description |
|---|---|
| String |
Examples
bytes.ToString(Encoding.UTF8);
Exceptions
| Type | Condition |
|---|---|
| ArgumentException |
|
| ArgumentNullException |
|
| DecoderFallbackException |
EncodeToString(Byte[], Encoding)
转换为字符串
Declaration
public static string EncodeToString(this byte[] this, Encoding encoding)
Parameters
| Type | Name | Description |
|---|---|---|
| Byte[] | this | |
| Encoding | encoding | 编码格式 |
Returns
| Type | Description |
|---|---|
| String |
Examples
bytes.ToString(Encoding.UTF8);
Exceptions
| Type | Condition |
|---|---|
| ArgumentException |
|
| ArgumentNullException |
|
| ArgumentNullException |
|
| DecoderFallbackException |