Code example for DataOutputStream

Methods: writeByte, writeInt, writeUTF

0
     * @param out the stream to write into 
     * @param version the version to write 
     * @throws IOException if an error occurs 
     */ 
    public static void write( DataOutputStream out, Version version ) throws IOException{
        out.writeByte( 1 );
        out.writeInt( version.major );
        out.writeInt( version.minor );
        out.writeInt( version.mikro );
        out.writeUTF( version.add );
    } 
     
    /** 
     * Reads a version that was stored earlier. 
     * @param in the stream to read from 
     * @return the new version 
     * @throws IOException if an error occurs or the format is unknown 
     */ 
    public static Version read( DataInputStream in ) throws IOException{
        byte version = in.readByte();
        if( version != 1 )