uima-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Adam Lally <ala...@alum.rpi.edu>
Subject Re: XmiCasDeserializer.deserialize with InputSource rather than InputStream
Date Sun, 22 Aug 2010 20:24:54 GMT
On Sun, Aug 22, 2010 at 8:52 AM, John Wiesel <john.wiesel@fu-berlin.de>wrote:

> Dear all,
>
> I am currently stalled in my project by XmiCasDeserializer.deserialize: I
> am wondering why there is no method that allows to directly set up the XML
> parser with a InputSource instead of an InputStream. I would like to load
> my CAS from an XMI file that I have cached in a CharArray. As I cannot
> generate an InputStream from a String (StringBufferInputStream is
> deprecated since JDK 1.1) but should be able to do so using an InputSource
> w/o much trouble, I hope there is a sensible solution for this that I just
> haven't thought of yet.
>
>
To get an InputStream from a String, you can convert the String to bytes,
using for example:
 String.getBytes("UTF-8")

and then use a ByteArrayInputStream.

 -Adam

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message