Subversion Repositories programming

Rev

Rev 215 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 215 Rev 218
Line 67... Line 67...
67
                return convertToByteArray(encodingTable[i][0]);
67
                return convertToByteArray(encodingTable[i][0]);
68
 
68
 
69
        throw new IllegalArgumentException();
69
        throw new IllegalArgumentException();
70
    }
70
    }
71
 
71
 
-
 
72
    /**
-
 
73
     * Method: convertToByteArray()
-
 
74
     * Purpose: Convert a String to a byte[], useful for sending
-
 
75
     * over the network in a Datagram.
-
 
76
     */
72
    public static byte[] convertToByteArray (String num)
77
    public static byte[] convertToByteArray (String num)
73
    {
78
    {
74
        int i;
79
        int i;
75
        byte[] ret = new byte[num.length()];
80
        byte[] ret = new byte[num.length()];
76
        byte temp;
81
        byte temp;
Line 88... Line 93...
88
        }
93
        }
89
 
94
 
90
        return ret;
95
        return ret;
91
    }
96
    }
92
 
97
 
-
 
98
    /**
-
 
99
     * Method: convertToString()
-
 
100
     * Purpose: Convert a byte[] to a String. This is really useful for
-
 
101
     * performing table lookups in the Encoder / Decoder.
-
 
102
     */
93
    public static String convertToString (byte[] num)
103
    public static String convertToString (byte[] num)
94
    {
104
    {
95
        int i;
105
        int i;
96
        String s = new String();
106
        String s = new String();
97
 
107