23 lines
772 B
C#
23 lines
772 B
C#
// <copyright file="Program.cs" company="PlaceholderCompany">
|
|
// Copyright (c) PlaceholderCompany. All rights reserved.
|
|
// </copyright>
|
|
|
|
using System.Text;
|
|
|
|
// Initialize a MemoryStream to store user input temporarily
|
|
using MemoryStream userInputStream = new();
|
|
|
|
// Convert user input string to byte array
|
|
string userInput = "Sample user input data";
|
|
|
|
byte[] inputData = Encoding.UTF8.GetBytes(userInput);
|
|
|
|
// Write user input data to the MemoryStream
|
|
userInputStream.Write(inputData, 0, inputData.Length);
|
|
var buffer = new byte[inputData.Length];
|
|
userInputStream.Position = 0;
|
|
userInputStream.Read(buffer);
|
|
var text = Encoding.UTF8.GetString(buffer, 0, buffer.Length);
|
|
|
|
// Perform further processing with the stored user input
|
|
Thread.Sleep(1000); |