Questions tagged [memorystream]
A memory stream is a kind of stream that has several methods to access and store data in memory.
memorystream
1,269
questions
0
votes
2
answers
37
views
When to close memory streams if they are returned in methods and controllers
I have some code that will be generating an excel report and I am planning on using it for some scheduled tasks but always wanted to return it from my API endpoint as well. My code for my controller ...
1
vote
1
answer
53
views
Write and read string from MemoryStream
Please consider this scenario:
I want to read a file and then place its bytes to MemoryStream and then write some strings to it and then immediately read entire MemotyStream. For example I have a text ...
0
votes
1
answer
42
views
Load picture from SQL and set it as a picturebox image in C# [closed]
I am using this code to load an image from SQL and set it as a picturebox image. but the code does not work. I use "image"/"varbinary(Max)" for Logo image in SQL Server.
byte[] ...
0
votes
0
answers
41
views
SaveAs(memoryStream) Takes too long
I have a serious problem with this code:
ajaxAuthenticator.Authenticate();
XLWorkbook template = templateBuilder.BuildTemplate();
using (MemoryStream memoryStream = new MemoryStream())
{
...
0
votes
1
answer
20
views
How to include the file name and the file extension when using MemoryStream in blazor webassembly
Here is my code
getting the file from FileSelectFileInfo
public FileSelectFileInfo selectedFile { get; set; }
then if there is a selected file, i store it in the variable above
private async Task ...
0
votes
0
answers
36
views
How to copy a single IFormFile to multiple memorystream concurrently
I have a IFormFile which I pass as a parameter to two separate asynchronous functions which convert the IFormFile to a memorystream which one uploads to OneDrive via ms graph and one uploads the other ...
0
votes
0
answers
47
views
How to create a ZIP file from byte array using Microsoft.IO.RecyclableMemoryStream?
I need to save a byte array as a compressed ZIP file. As MemoryStream can grow large and cause out-of-memory exceptions on our shared Azure server instances, I'm using Microsoft.IO....
0
votes
0
answers
48
views
Unity AudioClip.PCMReaderCallback is not being called when audioBuffer is written
I'm having some trouble with using PCMReaderCallback. The callback is never called when the audioBuffer is filled. It should be called automatically by Unity. Here is a sample of my code:
private ...
1
vote
0
answers
57
views
Forwarding file stream to client in Blazor WebServer in .NET 8
I'm writing a Blazor WebServer application which, at one point, allows the client to download a file. This file is forwarded from another API, which offers it as an application/octet-stream message, ...
0
votes
0
answers
88
views
How to avoid "Cannot access a disposed object" MemoryStream errors in async lambda functions
I have an issue that I can solve by running my code synchronously and it works great but to reduce wait time for my users I need to run async for this method as I have a few other tasks that need to ...
0
votes
0
answers
31
views
.Net 6 StreamReader.ReadBlockAsync throw System.ObjectDisposedException when reading file
I have a problem when trying to read a file from an FTP server. Thousands of files have been read without problem. This problem only occurs for 1 file. The problem occurs when I use the method ...
0
votes
1
answer
121
views
How to create Javascript WritableStream on memory (like fs.creareWriteStream)
I try to use some JS library with ServiceWorker, without access to Node.JS FileSystem functionality. That original library export result in the same way
Import * as fs from 'fs'
...
JsLib.export(...
1
vote
1
answer
91
views
Configuring Apache Spark's MemoryStream to simulate Kafka stream
I was requested to look into using Apache Spark's MemoryStream to simulate a Kafka stream in a Java Spring Boot service. The documentation / online community is a bit small on this topic so I am ...
0
votes
1
answer
34
views
"Parameter is not valid" exception when using Image.FromStream() - UDP Video live stream
I am trying to live stream the camera from a Raspberry pi to a PC with UDP. I followed the example code provided by the Picamera2 library to send the livestream data with python and am using C# ...
0
votes
0
answers
34
views
WPF How to show a MemoryStream PDF document to a WebBrowser
I cant show a pdf document save it in a database table direcly to a WebBrowser using a MemoryStream.
I have a DataBase with pfd documents saved in a table filed, and I want to show the pdf document ...