I have a function to get data from a network endpoint
public Byte[] GetData(string ip, int port ,Byte [] query, int responseLen)
{
Connection connection = GetConnection(ip,port);
Byte[] data;
try
{
data = connection.GetData(query, responseLen);
}
catch(IOException e)
{
//return an empty array
data = new Byte[] { };
}
return data;
}
In case there is an exception from GetData
function I am returning an empty array to the caller of GetData
function.
I want to know how the caller can test if the byte array returned is empty or non-empty