Code example for PrintStream

Methods: close, print

0
			return false; 
		} 
		PrintStream out = null;
		try { 
			// specifying 8192 gets rid of an annoying warning message 
			out = new PrintStream(new BufferedOutputStream(new FileOutputStream(newFile, false), 8192));
			 
			out.print(filetext);
			 
		} catch (FileNotFoundException ex) {
			log.e(ex,"unexpected exception");
			return false; 
		} finally { 
			if (out != null) {
				out.close();
			} 
		} 
		 
		return true;