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