storeDocument(doc);
	public void addDocument(Collection collection, DocumentImpl doc)		throws PermissionDeniedException {		Value name;		try {			name = new Value(collection.getName().getBytes("UTF-8"));		} catch (UnsupportedEncodingException uee) {			LOG.debug(uee);			name = new Value(collection.getName().getBytes());		}		try {			VariableByteOutputStream ostream = new VariableByteOutputStream();			doc.write(ostream);			byte[] data = ostream.toByteArray();			synchronized (collectionsDb) {				if (!collectionsDb.append(name, data)) {					LOG.debug(						"could not store collection data for "							+ collection.getName());					return;				}			}		} catch (IOException ioe) {			LOG.debug(ioe);		} catch (ReadOnlyException e) {			LOG.warn("database is read-only");		}	}