Apphost: Handle long paths while reading bundles (dotnet/core-setup#5948)
Handle path-lengths larger than 127 bytes in:
- Bundle ID (also a component of the extraction path)
- relative-path (path of a file within the bundle)
The above strings are encoded as length prefixed strings by System.IO.BinaryWriter.Write()
The length itself is encoded as a series of bytes where
- 7-bits contain length bits
- 8th bit indicates whether there are more bytes to follow.
For a path, there can be a maximum of two bytes (max 4096)
This commit handles the case where a path length is long enough to be need two bytes.
Also added a test case.
Fixes dotnet/core-setup#5932
Commit migrated from https://github.com/dotnet/core-setup/commit/
9889b387cff5086f09ef174c5e73c278d3dba208