Updated the directory2bytes function in Directory.java