// Directory Entry Class // George F. Riley, ECE3055, Spring 2003 import java.io.*; class dirent { public char[] fileName = new char[8]; public int fileSize = 0; public int firstCluster = 0; public dirent() { // Constructor clear(); } public void clear() { // Clear a directory entry for (int i = 0; i < 8; ++i) fileName[i] = '\0'; fileSize = 0; firstCluster = 0; } public void readExternal(DataInputStream in) throws IOException { for (int i = 0; i < 8; ++i) fileName[i] = in.readChar(); fileSize = in.readInt(); firstCluster = in.readInt(); } public void writeExternal(DataOutputStream out) throws IOException { for (int i = 0; i < 8; ++i) out.writeChar(fileName[i]); out.writeInt(fileSize); out.writeInt(firstCluster); } }