Code example for ByteArrayOutputStream

Methods: close, toString

0
	 * @param profiles 
	 * @param instanceScope 
	 * @throws CoreException 
	 */ 
	public void writeProfiles(Collection profiles, IScopeContext instanceScope) throws CoreException {
		ByteArrayOutputStream stream= new ByteArrayOutputStream(2000);
		try { 
			writeProfilesToStream(profiles, stream, ENCODING);
			String val;
			try { 
				val= stream.toString(ENCODING);
			} catch (UnsupportedEncodingException e) {
				val= stream.toString(); 
			} 
			IEclipsePreferences uiPreferences = instanceScope.getNode(pluginId);
			uiPreferences.put(fProfilesKey, val);
			uiPreferences.putInt(fProfilesVersionKey,1);
		} finally { 
			try { stream.close(); } catch (IOException e) { /* ignore */ }
		} 
	} 
	 
	/** 
	 * @param profiles