Exemplo n.º 1
0
 public static IByteBuffer CopiedBuffer(string value, Encoding encoding) => ByteBufferUtil.EncodeString0(Allocator, true, value, encoding, 0);
Exemplo n.º 2
0
 /// <summary>Encode the given <see cref="string" /> using the given <see cref="Encoding" /> into a new
 /// <see cref="IByteBuffer" /> which is allocated via the <see cref="IByteBufferAllocator" />.</summary>
 /// <param name="src">src The <see cref="string" /> to encode.</param>
 /// <param name="encoding">charset The specified <see cref="Encoding" /></param>
 /// <param name="extraCapacity">the extra capacity to alloc except the space for decoding.</param>
 public static IByteBuffer EncodeString(string src, Encoding encoding, int extraCapacity = 0) => ByteBufferUtil.EncodeString0(Allocator, false, src, encoding, extraCapacity);