Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ OpenStream()

override Stream ReLogic.Content.Sources.FileSystemContentSource.OpenStream ( string fullAssetName)
inline

Must be threadsafe!

Implements ReLogic.Content.Sources.IContentSource.

Definition at line 26 of file FileSystemContentSource.cs.

27 {
29 {
30 throw AssetLoadException.FromMissingAsset(assetName);
31 }
32 if (!File.Exists(value))
33 {
34 throw AssetLoadException.FromMissingAsset(assetName);
35 }
36 try
37 {
38 return File.OpenRead(value);
39 }
41 {
42 throw AssetLoadException.FromMissingAsset(assetName, innerException);
43 }
44 }
readonly Dictionary< string, string > _nameToAbsolutePath
bool TryGetValue(TKey key, [MaybeNullWhen(false)] out TValue value)
static bool Exists([NotNullWhen(true)] string? path)
Definition File.cs:97
static FileStream OpenRead(string path)
Definition File.cs:236

References ReLogic.Content.Sources.FileSystemContentSource._nameToAbsolutePath, System.IO.File.Exists(), ReLogic.Content.AssetLoadException.FromMissingAsset(), System.IO.File.OpenRead(), System.Collections.Generic.Dictionary< TKey, TValue >.TryGetValue(), and System.value.