java version of SplitDatafile