/* class with static methods to manipulate buffers and strings. */ public class myutils { // extracts bytes from buffer, starting at index i and of max length l, // or until zero encountered, or until end of buffer. public static String bufToString(byte[] buffer, int i, int l) { String s = ""; while (i>=0 && (i0) { s = s+(char)buffer[i++]; l--; } return s; } // The next function will take a string and write to a buffer starting // at the given index i, and terminating the buffer with a zero. // The function will return index of terminating zero. public static int StringToBuf(byte[] buffer, String s, int i) { int j = 0; while (i>=0 && i0) { dst[di++] = src[si++]; l--; } } // checks if two byte[]'s are equal public static boolean bufeq(byte[] A, byte[] B) // buffer equality { if (A.length != B.length) return false; boolean ax = true; for (int i=0;i