how to get the file signature in java? for example a pdf file has signature 25 50 44 46 ..how to get it using java?
N S K
0
Newbie Poster
Recommended Answers
Jump to PostThose are the first bytes in the file, yes?
Just open a FileInputStream with that file and read the first 4 bytes into a 4 byte array where you can check the values. Then close the stream.
All 4 Replies
JamesCherrill
4,733
Most Valuable Poster
Team Colleague
Featured Poster
overwraith
83
Newbie Poster
JamesCherrill
4,733
Most Valuable Poster
Team Colleague
Featured Poster
N S K
0
Newbie Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.