Java class to read data