public void Write(FileFingerprint fileFingerprint) { var writer = _pipe.Writer; var blob = MessagePackSerializer.SerializeUnsafe(fileFingerprint).AsSpan(); var lengthBlob = IntFormatter.Serialize(ref _intBuffer, 0, blob.Length, MessagePackSerializer.DefaultResolver); var outputLength = lengthBlob + blob.Length; var output = writer.GetSpan(outputLength); Debug.Assert(output.Length >= outputLength); _intBuffer.AsSpan(0, lengthBlob).CopyTo(output); output = output.Slice(lengthBlob); blob.CopyTo(output); writer.Advance(outputLength); }
public IntValue(string formatstring, int data) { Formatter = new IntFormatter(formatstring); Data = data; }