protected internal virtual void WriteData(byte[] buf, int offset, int len) { if (mClosed) { if (mFailedWithError) { throw new IOException(TLS_ERROR_MESSAGE); } throw new IOException("Sorry, connection has been closed, you cannot write more data"); } while (len > 0) { if (mSplitApplicationDataRecords) { SafeWriteRecord(23, buf, offset, 1); offset++; len--; } if (len > 0) { int num = Math.Min(len, mRecordStream.GetPlaintextLimit()); SafeWriteRecord(23, buf, offset, num); offset += num; len -= num; } } }