[kepler-dev] string encodings
Efrat Jaeger
efrat at sdsc.edu
Mon Aug 9 22:01:22 PDT 2004
Hi Tobin,
There is a BinaryFileReader actor under 'geon' that returns an unsigned
bytes array. Perhaps this may help you.
Efrat
----- Original Message -----
From: "Tobin Fricke" <tobin at splorg.org>
To: <kepler-dev at ecoinformatics.org>
Sent: Monday, August 09, 2004 3:11 PM
Subject: Re: [kepler-dev] string encodings
> On Mon, 9 Aug 2004, Tobin Fricke wrote:
>
> > I am using FileReader to read a binary file into a StringToken.
>
> This is somewhat suspicious (in FileReader.java) -- note the silent
> newline translation that makes FileReader break with binary files:
>
> BufferedReader reader = fileOrURL.openForReading();
> StringBuffer lineBuffer = new StringBuffer();
> String newline = System.getProperty("line.separator");
> while (true) {
> String line = reader.readLine();
> if (line == null) break;
> lineBuffer = lineBuffer.append(line);
> lineBuffer = lineBuffer.append(newline);
> }
> fileOrURL.close();
> output.broadcast(new StringToken(lineBuffer.toString()));
>
> --tobin
> _______________________________________________
> kepler-dev mailing list
> kepler-dev at ecoinformatics.org
> http://www.ecoinformatics.org/mailman/listinfo/kepler-dev
>
More information about the Kepler-dev
mailing list