Index and count must refer to a location within the buffer. How to solve (Parameter 'bytes') error - C#