'MagicNumbers for Multipart File in Java

I'm trying to implement magic numbers checker in Java. Files are send to server as MultipartFile, when I'm checking file (for example PDF) instead of 0x25, 0x50 it is giving me much different numbers, is it because of storing file in multiple files? If so, how can I check those magic numbers?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source