Question:

How to read a byte array in asp.net c# n wat if i want to fetch sum value within a range from that array?????

by  |  earlier

0 LIKES UnLike

How to read a byte array in asp.net c# n wat if i want to fetch sum value within a range from that array?????

 Tags:

   Report

1 ANSWERS


  1. The answer to your question depends on where you want to read the byte array from.

    For example, if you are reading a file as a byte array you will want to use a StreamReader in conjunction with a BinaryReader.

    private byte[] GetBytes(string serverPath)

        {

            FileStream Stream = new FileStream( serverPath, FileMode.Open, FileAccess.Read );

            BinaryReader Reader = new BinaryReader( Stream );

            byte[] byteArray = Reader.ReadBytes( (int)Stream.Length );

            Reader.Close();

            Stream.Close();

            return byteArray;

        }

Question Stats

Latest activity: earlier.
This question has 1 answers.

BECOME A GUIDE

Share your knowledge and help people by answering questions.