public byte[] getFileBytes(short fid) {
		byte[] result = filesBytes.get(fid);
		if (result != null) {
			return result;
		}
		InputStream in = getInputStream(fid);
		if (in == null) {
			return null;
		}
		ByteArrayOutputStream out = new ByteArrayOutputStream();
		byte[] buf = new byte[256];
		while (true) {
			try {
				int bytesRead = in.read(buf);
				if (bytesRead < 0) {
					break;
				}
				out.write(buf, 0, bytesRead);
			} catch (IOException ioe) {
				ioe.printStackTrace();
			}
		}
		return out.toByteArray();
	}