From 9699af93bc47a5ff8d7c070e8b16c1cef004a156 Mon Sep 17 00:00:00 2001 From: Matt Nadareski Date: Sat, 3 Dec 2022 21:37:05 -0800 Subject: [PATCH] Add temporary helper method for NE --- BurnOutSharp.Wrappers/NewExecutable.cs | 35 ++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/BurnOutSharp.Wrappers/NewExecutable.cs b/BurnOutSharp.Wrappers/NewExecutable.cs index cd8d9947..6683d5ef 100644 --- a/BurnOutSharp.Wrappers/NewExecutable.cs +++ b/BurnOutSharp.Wrappers/NewExecutable.cs @@ -596,5 +596,40 @@ namespace BurnOutSharp.Wrappers } #endregion + + #region REMOVE -- DO NOT USE + + /// + /// Read an arbitrary range from the source + /// + /// The start of where to read data from, -1 means start of source + /// How many bytes to read, -1 means read until end + /// Byte array representing the range, null on error + [Obsolete] + public byte[] ReadArbitraryRange(int rangeStart = -1, int length = -1) + { + // If we have an unset range start, read from the start of the source + if (rangeStart == -1) + rangeStart = 0; + + // If we have an unset length, read the whole source + if (length == -1) + { + switch (_dataSource) + { + case DataSource.ByteArray: + length = _byteArrayData.Length - _byteArrayOffset; + break; + + case DataSource.Stream: + length = (int)_streamData.Length; + break; + } + } + + return ReadFromDataSource(rangeStart, length); + } + + #endregion } } \ No newline at end of file