writeDouble() method of DataOutputStream is writing data in text document in encoded form
问题 I have the following code public static void main(String aed[]){ double d=17.3; try{ DataOutputStream out=null; out=new DataOutputStream(new BufferedOutputStream(new FileOutputStream("new.txt"))); out.writeDouble(d); out.flush(); }catch(FileNotFoundException fnf){ fnf.printStackTrace(); }catch(IOException io){ io.printStackTrace(); } } Now I am writing this double value to a text file new.txt , but following value is getting in text file @1LÌÌÌÌÍ But when i use out.writeUTF(""+d) It works