Fix bug in querying with requiring java.io ByteArrayOutputStream

Oups, sorry, forgot about that..