source: other-projects/rsyntax-textarea/devel-packages/jflex-1.4.3/examples/binary/README@ 25584

Last change on this file since 25584 was 25584, checked in by davidb, 12 years ago

Initial cut an a text edit area for GLI that supports color syntax highlighting

File size: 891 bytes
Line 
1This directory contains a small example of a scanner for binary files.
2
3The example tries to detect if an input file is a java class file by
4checking if the first 4 bytes contain the magic number 0xCAFEBABE.
5It uses a custom Reader class that copies bytes to characters one to
6one. The characters the scanner gets to read are the bytes from the
7input stream without any conversion. Many thanks to Stephen Ostermiller
8for providing the custom Reader class, the original version of that
9class is available from http://www.smo.f2s.com/utils/
10
11See the JFlex manual for details on how to scan binaries and how
12this is different from scanning text files.
13
14Files:
15binary.flex the scanner spec
16StraightStreamReader.java the custom reader class (by Stephen Ostermiller)
17Makefile rules for make to compile and run the example
18README this file
Note: See TracBrowser for help on using the repository browser.