How to find out is bytes array has any data or it is newly created bytes array?
var Buffer = new byte[1000];
//How to find out is Buffer is empty or not?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
I assume by ’empty’ you mean containing default values for every byte element, if this isn’t what you mean, look at @sehe’s answer.
How about using LINQ to check whether all elements have the default value for the type: