Code example for DataOutputStream

Methods: close, writeBytes

0
	 * @throws IOException  
	 * @throws UnsupportedEncodingException  
	 */ 
	public static void main(String[] args) throws UnsupportedEncodingException, IOException  {
		File f = new File("input.txt");
		DataOutputStream out = new DataOutputStream(new FileOutputStream(f));
		out.writeBytes("Helooooooooo\n helooooooo");
		out.close();
		 
		 
		DataInputStream in = new DataInputStream(new FileInputStream(f));
		byte b[] = new byte [1000];
		 
		String s = in.readLine();
		System.out.println(s);
		in.close();
		 
		 
		 
	}