• Post Reply Bookmark Topic Watch Topic
  • New Topic

Can i check i byte[] contains binary bytes ???  RSS feed

 
Frank Jacobsen
Ranch Hand
Posts: 358
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a byte[], and if its contains binary bytes i have to set up an exception, can i check this, and if how ???


Frank
 
Shaan Shar
Ranch Hand
Posts: 1249
Java Spring Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Frank Jacobsen:
I have a byte[], and if its contains binary bytes i have to set up an exception, can i check this, and if how ???


Frank


Frank,

What do you mean by binary bytes.

Come up with some more context.
 
Ernest Friedman-Hill
author and iconoclast
Sheriff
Posts: 24217
38
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Off to Java in General (Beginner).
 
Frank Jacobsen
Ranch Hand
Posts: 358
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
jMimeMagic is a Java library for determining the MIME type of files or streams, this you can find on google i you search on jMimeMagic, but is this possible without using this jar file from jMimeMagic ???


Frank
 
Ernest Friedman-Hill
author and iconoclast
Sheriff
Posts: 24217
38
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
So by "binary bytes" you mean that the bytes represent certain non-text file types? Well, some file types have a magic number -- the first few bytes are always some certain value that identifies the file. For example, the first four bytes of a Java class file are 0xCA 0xFE 0xBA 0xBE , and the first few bytes of a GIF image are 0x47 0x49 0x45. But not all file types have a magic number, which is why figuring out the type of a file from the bytes is sometimes tricky.

The web site Wotsit's Format is a repository of information about file formats: it will likely have all known information about whatever file formats you're interested in.
 
Frank Jacobsen
Ranch Hand
Posts: 358
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks a lot, just what i was searching fore

Frank
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!