StreamReader: Reading the last line of a stream

I’m using a StreamReader to read exported data from the DCS flight simulator. It exports every frame. I created an app to display that data on my tablet over wifi.

My issue is that the stream data seems to get bogged down (may be my tablet’s processing power) so the data that is being displayed is old data instead of current data. That makes information on my screen (speed, altitude, etc.) rather useless.

Is there a way that I can make the StreamReader read only the very last line of the stream (the actual current data)?

DCS usually allows for a timed export (every second or two or whatever interval you want), but I cannot get it to work with the multiplayer server I play on. However, it does work with the every-frame method.

I just want to use a script in Unity to process the last line of the stream every second, not every single line.

I’m rather new to StreamReader, so I don’t know how to find the last line in an efficient manner. Thank you! :slight_smile: