io
Class DataStreamConvert

java.lang.Object
  extended by util.CommandLineParser
      extended by io.DataStreamConvert

public class DataStreamConvert
extends CommandLineParser

Reads a java binary data stream and converts it into ascii data. It is\ essential to state the '-format' command line switch. This switch regulates which and how many primitive data types should be read from the binary file and put into a single line in the ascii file. Known primitive identifier are

No modifier for reading a binary boolean is given. Binary booleans are writtn like bytes and should thus be read in as bytes as well. As an example, a -format 'f d f i' tries to read a float a double, a float again and an integer from the binary file. If no exception is thrown, the ascii representation of these numbers are writtn to the output file.


Nested Class Summary
 
Nested classes/interfaces inherited from class util.CommandLineParser
CommandLineParser.Test
 
Field Summary
private static String FOOT
          A footer message.
private static String SWITCHES
          Switches with one argument.
private static Map<String,String> USE
          Detailed use of switches.
 
Constructor Summary
DataStreamConvert()
          Sets up the data stream converter.
 
Method Summary
static void main(String[] arg)
          Parses the command line and prints output to standard out.
private  void process(String[] arg)
          Processes the command line if no file or no format is given, a usage message is displayed and nothing else is changed.
 
Methods inherited from class util.CommandLineParser
getArguments, getCommandLine, getCommands, getRegisteredSwitches, hasAnySwitch, hasSwitch, hasSwitch, haveAllSwitches, parse, printCommandLine, registerLine, registerSwitches, setCommands, staticUsage, usage
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SWITCHES

private static final String SWITCHES
Switches with one argument.

See Also:
Constant Field Values

USE

private static final Map<String,String> USE
Detailed use of switches.


FOOT

private static final String FOOT
A footer message.

See Also:
Constant Field Values
Constructor Detail

DataStreamConvert

public DataStreamConvert()
Sets up the data stream converter.

Method Detail

process

private void process(String[] arg)
              throws ParseException,
                     IOException
Processes the command line if no file or no format is given, a usage message is displayed and nothing else is changed. Catches EOF-exceptions, but not general IOException.

Throws:
ParseException
IOException

main

public static void main(String[] arg)
                 throws ParseException,
                        IOException
Parses the command line and prints output to standard out.

Throws:
ParseException
IOException