Code example for StringWriter

Methods: close, toString

0
		return null; 
	} 
	 
	 
	public static String writeAddressToJson(Address address) {
		StringWriter sWriter = new StringWriter();
		JsonWriter jWriter = new JsonWriter(sWriter);
		 
		writeAddress(jWriter, address);
		 
		String output = sWriter.toString();
		 
		try { 
			jWriter.close();
			sWriter.close();
		} catch (IOException e) {
			Log.e(TAG, "IOException closing writer(s)");
		} 
		 
		return output;
	}