private static void WriteAndRead(TlsProtocol writer, TlsProtocol reader, byte[] data, bool fragment) { int dataSize = data.Length; writer.OfferOutput(data, 0, dataSize); PumpData(writer, reader, fragment); Assert.AreEqual(dataSize, reader.GetAvailableInputBytes()); byte[] readData = new byte[dataSize]; reader.ReadInput(readData, 0, dataSize); AssertArrayEquals(data, readData); }