Added MemoryStreamDebugVisualizer
This commit is contained in:
23
MemoryStreamDebugVisualizer/TestApp/Program.cs
Normal file
23
MemoryStreamDebugVisualizer/TestApp/Program.cs
Normal file
@@ -0,0 +1,23 @@
|
||||
// <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);
|
||||
Reference in New Issue
Block a user