aspose file tools
The moose likes Beginning Java and the fly likes Can i check i byte[] contains binary bytes ??? Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Reply Bookmark "Can i check i byte[] contains binary bytes ???" Watch "Can i check i byte[] contains binary bytes ???" New topic
Author

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

Frank Jacobsen
Ranch Hand

Joined: May 17, 2002
Posts: 335
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
Ankur Sharma
Ranch Hand

Joined: Dec 27, 2005
Posts: 1234
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.


The Best way to predict your future is to create it
Ankur Sharma
Ernest Friedman-Hill
author and iconoclast
Marshal

Joined: Jul 08, 2003
Posts: 24061
    
  13

Off to Java in General (Beginner).


[Jess in Action][AskingGoodQuestions]
Frank Jacobsen
Ranch Hand

Joined: May 17, 2002
Posts: 335
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
Marshal

Joined: Jul 08, 2003
Posts: 24061
    
  13

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

Joined: May 17, 2002
Posts: 335
Thanks a lot, just what i was searching fore

Frank
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: Can i check i byte[] contains binary bytes ???
 
Similar Threads
Reading bytes and bits
how to append to word doc files
How to read the DESede encrypted value using a Java Program
finding a String in an InputStream
Loading Binary files