Forum

RAW Reader output not Persistent?

devvvv

#1

Hi,

while working with RAW Datatypes I encountered a wired behavior.
After reading a file the Output of that File is visible inside the IO BOX.
But for the following Nodes the Output is only available if Read during the exact same Frame.
Not sure if that is a bug or feature but it definitely feels wired to me.

I attached a simple Patch and Plugin i have been working on which helps to understand the Problem.

StringBase64.zip (2.9 MB)


#2

You need to reset the position of the input stream:

var byteStream = FInput[i](i);
// When working with streams make sure to reset their position
// before reading from them.
byteStream.Position = 0;
if (FInputLineBreaks[i](i))
	FOutput[i](i) = Convert.ToBase64String(BytestreamToArray(byteStream), Base64FormattingOptions.InsertLineBreaks);
else
	FOutput[i](i) = Convert.ToBase64String(BytestreamToArray(byteStream));

#3

Thanks Elias,
was not aware about that one.