read and write differert format files---java