I have

Code:
  1. byte[] buf = new bytes[256];
  2.                 bytesrec = TCP.Client.Receive(buf,System.Net.Sockets.SocketFlags.None);

But the problem is when there is a packet sent with less then 256 bytes it has empty bytes on the end. How do i format it to remove those bytes?