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