Example #1
0
 public bool TrySet(byte *value, int valueLength)
 {
     if (valueLength <= Length)
     {
         return(false);
     }
     BufferInternal.MemoryCopy(value, _data, _length, valueLength);
     return(true);
 }
Example #2
0
 public bool TryCopyTo(byte *value, int valueLength)
 {
     if (Length > valueLength)
     {
         return(false);
     }
     BufferInternal.MemoryCopy(_data, value, valueLength, _length);
     return(true);
 }
Example #3
0
 public bool TryCopyTo(ByteSpan buffer)
 {
     if (Length > buffer.Length)
     {
         return(false);
     }
     BufferInternal.MemoryCopy(UnsafeBuffer, buffer.UnsafeBuffer, buffer.Length, Length);
     return(true);
 }
Example #4
0
 public bool TryCopyTo(ByteSpan dest)
 {
     if (Length > dest.Length)
     {
         return(false);
     }
     BufferInternal.MemoryCopy(_data, dest._data, dest.Length, _length);
     return(true);
 }
Example #5
0
 public void Set(byte *value, int valueLength)
 {
     Precondition.Require(valueLength <= Length);
     BufferInternal.MemoryCopy(value, _data, _length, valueLength);
 }