Binary Stream Editor Code
A stream editor in java that can handle text/binary formats
Status: Alpha
Brought to you by:
manojmokashi
A stream editor that can be invoked by a java program or also the command line. It can handle binary data too. Unlike newline based programs like sed, it allows different ways of reading the stream through the traverser, buffer and commands interfaces. A traverser decides how the data is read. This data is stored in the Buffer. The commands access the data in the Buffer and process it. All data is handled as characters, by specifying an encoding. For binary data, the encoding ISO-8859-1 is used by default, in which one character corresponds to one byte. Data in the Buffer is available as a String to the commands for stuff like regex matching etc. The output can be redirected to a file, and an output encoding can be specified. This can allow encoding conversions. The commands can also store/retrive arbitrary data for later use in a map. Evaluation of expressions in commands is done using Apache Jexl, and custom functions can also be used by setting up a properties file. A command line invoker uses a command parser to parse the commands. The BinaryStreamEditorTest.java and SampleUses.java are examples of use from Java. The bse.bat, splitter.bat, searchbinary.bat, cutpos.sh are examples of command-line invocation.