public void Bytes() { IBufferWriter <byte> bufferWriter = new TestBufferWriter(); var writer = BufferWriter.Create(bufferWriter); writer.Write(Encoding.UTF8.GetBytes("Hello")); writer.Write(Encoding.UTF8.GetBytes(" World!")); writer.Flush(); Assert.Equal("Hello World!", bufferWriter.ToString()); }
public void Writable() { IBufferWriter <byte> bufferWriter = new TestBufferWriter(); var writer = BufferWriter.Create(bufferWriter); var ulonger = new UInt128(); ulonger.Lower = ulong.MaxValue; ulonger.Upper = 1; writer.Write(ulonger, s_base64); writer.Write(ulonger, 't'); writer.Write(123); writer.Write("This is just a longish string"); writer.Flush(); Assert.Equal("//////////8BAAAAAAAAAA==hello123This is just a longish string", bufferWriter.ToString()); }