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

◆ WriteAllBytes()

static void System.IO.File.WriteAllBytes ( string path,
byte[] bytes )
inlinestatic

Definition at line 342 of file File.cs.

343 {
344 if (path == null)
345 {
346 throw new ArgumentNullException("path", SR.ArgumentNull_Path);
347 }
348 if (path.Length == 0)
349 {
350 throw new ArgumentException(SR.Argument_EmptyPath, "path");
351 }
352 if (bytes == null)
353 {
354 throw new ArgumentNullException("bytes");
355 }
356 using SafeFileHandle handle = OpenHandle(path, FileMode.Create, FileAccess.Write, FileShare.Read, FileOptions.None, 0L);
357 RandomAccess.WriteAtOffset(handle, bytes, 0L);
358 }
static SafeFileHandle OpenHandle(string path, FileMode mode=FileMode.Open, FileAccess access=FileAccess.Read, FileShare share=FileShare.Read, FileOptions options=FileOptions.None, long preallocationSize=0L)
Definition File.cs:1009

References System.SR.Argument_EmptyPath, System.SR.ArgumentNull_Path, System.bytes, System.handle, System.L, System.IO.File.OpenHandle(), and System.IO.RandomAccess.WriteAtOffset().