We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 8f8a8b8 commit 5c66ef3Copy full SHA for 5c66ef3
1 file changed
src/extensions/BootstrapBlazor.Socket/PropertyConverter/DataByteConverter.cs
@@ -0,0 +1,20 @@
1
+// Copyright (c) BootstrapBlazor & Argo Zhang (argo@live.ca). All rights reserved.
2
+// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
3
+// Website: https://www.blazor.zone or https://argozhang.github.io/
4
+
5
+namespace BootstrapBlazor.Socket.DataConverters;
6
7
+/// <summary>
8
+/// Sokcet 数据转换为 byte 转换器
9
+/// </summary>
10
+public class DataByteConverter : IDataPropertyConverter
11
+{
12
+ /// <summary>
13
+ /// <inheritdoc/>
14
+ /// </summary>
15
+ /// <param name="data"></param>
16
+ public object? Convert(ReadOnlyMemory<byte> data)
17
+ {
18
+ return data.Span[0];
19
+ }
20
+}
0 commit comments