private void readall(InputStream in, byte[] buf) throws IOException {
		int ret, off = 0;
		while (off < buf.length) {
			ret = in.read(buf, off, buf.length - off);
			if (ret < 0)
				throw (new LoadException("Incomplete resource at " + name, this));
			off += ret;
		}
	}