if (mimeType.equals("text/html")) {
Resource resource = new Resource("http://127.0.0.1/", null, new ContentType(mimeType), data, 0, false);
org.w3c.dom.Document dom = resource.parseHTML();
TextRecord textRecord = new TextRecord("http://127.0.0.1/");
Transformer transformer = TransformerFactory.newInstance().newTransformer();
TextRecordResult result = new TextRecordResult(textRecord, new URIRewriter(), 100, false, document);
transformer.transform(new DOMSource(dom), result);
document.addRecord(textRecord);
} else if (mimeType.startsWith("image/")) {
BufferedImage image = ImageIO.read(new ByteArrayInputStream(data));
CompositeBitmap compositeBitmap = CompositeBitmap.create(image, bpp);