Search
 
SCRIPT & CODE EXAMPLE
 

CSHARP

c# load a file into binary buffer

public byte[] FileToByteArray(string fileName)
{
    byte[] buff = null;
    FileStream fs = new FileStream(fileName, 
                                   FileMode.Open, 
                                   FileAccess.Read);
    BinaryReader br = new BinaryReader(fs);
    long numBytes = new FileInfo(fileName).Length;
    buff = br.ReadBytes((int) numBytes);
    return buff;
}
Comment

PREVIOUS NEXT
Code Example
Csharp :: c# creat pen 
Csharp :: how to change the scale of a gameobject in unity 
Csharp :: c# KERNEL32.DLL recoverdeleted files 
Csharp :: Destroy(GameObject.Find("Turret_Laser_Hit"), 0.2f); 
Csharp :: C# Bitwise Left Shift 
Csharp :: vb.net substring after character 
Csharp :: parallelism in c# 
Csharp :: c# with keyword 
Csharp :: Razor switch statement 
Csharp :: GetNetworkTime 
Csharp :: C# change to different form 
Csharp :: c# hardcode datetime quoting 
Csharp :: calculated field gridview asp.net 
Csharp :: unity 3d animator live link 
Csharp :: How to enumerate an enum 
Csharp :: string to float c# 
Csharp :: How to scroll to bottom of ListBox 
Csharp :: chaine de connexion sql server c# 
Csharp :: unity button hover 
Csharp :: runner dotnet trace inside docker container 
Csharp :: Implementing Banner Ads Unity 
Csharp :: c# lambda get all records async 
Csharp :: slider script unity 
Csharp :: auto paly a video control in mvc c# 
Csharp :: unity organize variables in inspector 
Csharp :: how to make dobuble jump unity 2d 
Csharp :: how to make continuous progress bar 
Csharp :: compass direction mobile unity 
Csharp :: most popular products code using asp.net core in visual studio code 
Csharp :: short in c# 
ADD CONTENT
Topic
Content
Source link
Name
2+4 =