Code example for DataInputStream

Methods: readCharreadUTF

0
		OutputStream out = null;
		try { 
			out = new FileOutputStream("resources/temp.txt");
		} catch (FileNotFoundException e) {
			e.printStackTrace();
		} 
 
		Attr outAttr = new Attr("apple", 1);
		try { 
			outAttr.writeData(new DataOutputStream(out));
		} catch (IOException e) {
			e.printStackTrace();
		} 
 
		InputStream in = null;
		try { 
			in = new FileInputStream("resources/temp.txt");
		} catch (FileNotFoundException e) {
			e.printStackTrace();
		} 
 
		try { 
			Attr inAttr = new Attr(new DataInputStream(in));
			System.out.println(inAttr);
		} catch (IOException e) {
			e.printStackTrace();
		} 
 
Stop searching for code, let great code find you!  Add Codota to your java IDE