0

I am trying to easily check that my byte array is a successfully encoded PDF file. When I write all bytes the PDF is successfully created, however I read that a PDF is supposed to start with a particular set of bytes link below:

Determine if a byte[] is a pdf file

Mine however starts like this:

var test = new byte[] { 37, 80, 68, 70, 45, 49, 46, 52, 10, 37... 

Would a "SAFE" unit test check to see if these 10 first elements match? For example create the byte[] iterate through the first 10 elements and make sure that they follow the sequence of test.

Lostaunaum
  • 697
  • 1
  • 10
  • 31

0 Answers0