I hope it's not too late...
ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
document.save(byteArrayOutputStream);
document.close();
InputStream inputStream = new ByteArrayInputStream(byteArrayOutputStream.toByteArray());
And voila! You've got both input streams!
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…