[#26] All: Remove V2 from naming
Rename project, namespaces and class names Signed-off-by: Pavel Gross <p.gross@yadro.com>
This commit is contained in:
parent
c406df1a78
commit
766f61a5f7
219 changed files with 219 additions and 974 deletions
28
src/FrostFS.SDK.Client/Mappers/Session/SessionMapper.cs
Normal file
28
src/FrostFS.SDK.Client/Mappers/Session/SessionMapper.cs
Normal file
|
@ -0,0 +1,28 @@
|
|||
using System;
|
||||
|
||||
using Google.Protobuf;
|
||||
|
||||
namespace FrostFS.SDK.Client;
|
||||
|
||||
public static class SessionMapper
|
||||
{
|
||||
public static byte[] Serialize(this Session.SessionToken token)
|
||||
{
|
||||
if (token is null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(token));
|
||||
}
|
||||
|
||||
byte[] bytes = new byte[token.CalculateSize()];
|
||||
using CodedOutputStream stream = new(bytes);
|
||||
token.WriteTo(stream);
|
||||
|
||||
return bytes;
|
||||
}
|
||||
|
||||
public static Session.SessionToken Deserialize(this Session.SessionToken token, byte[] bytes)
|
||||
{
|
||||
token.MergeFrom(bytes);
|
||||
return token;
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue