[kepler-users] Size Limitation of ArrayTokens?

Stefan Proell sproell at sba-research.org
Mon May 21 11:50:04 PDT 2012


Dear Tom, Christopher and Matt,
thanks for the quick replies. I will have a closer look again tomorrow 
and let you know whether I could find the trick behind byte arrays.

Thank you very much,
Stefan

Am 2012-05-21 19:34, schrieb Thomas M. Parris:
> If it helps, we regularly read, process and write long streams of 720x360
> element double precision matrices using the PN directory without difficulty.
> The workflow is rather involved, so many such arrays are in memory at any
> given time.  So that's 259,200 elements and 2,073,600 bytes for each array.
>
> That said, I realize arrays are not the same as matrices.
>
> -- Tom
>
> -----Original Message-----
> From: kepler-users-bounces at kepler-project.org
> [mailto:kepler-users-bounces at kepler-project.org] On Behalf Of Christopher
> Brooks
> Sent: Monday, May 21, 2012 12:32 PM
> To: Stefan Proell
> Cc: kepler-users at kepler-project.org
> Subject: Re: [kepler-users] Size Limitation of ArrayTokens?
>
> HI Stefan,
> A quick search of the web shows no apparent limits.
> A more complete test case would help.
>
> The way I would approach this is by splitting up the problem into first just
> reading the data and being sure that worked and then adding more like
> encoding.
>
> _Christopher
>
> On 5/21/12 9:20 AM, Stefan Proell wrote:
>> Dear Mailing list,
>> I wrote my own Actor which I need in order to encode binary files via
>> Base64 and pass the resulting encoded String to a REST Service. I feed
>> the binary file with a BinaryFileReader-Actor to my encoding Actor and
>> cast the Token to an Array, as I found no other solution to receive
>> the bytes from the file. I then use a standard (and also deprecated)
>> method for encoding the file first to Base64 and then send it through
>> some URL-safe encoding. The method looks like this:
>>
>>
>> @Override
>>      public void fire() throws IllegalActionException {
>>
>>          super.fire();
>>
>>          // Read file from InputPort  and convert to a ByteArray
>>          ArrayToken inputToken = (ArrayToken) inputPort.get(0);
>>          byte[] inputBytes =
>> ArrayToken.arrayTokenToUnsignedByteArray(inputToken);
>>
>>          // Encoding
>>          String encode = new  String(Base64.encodeBase64(inputBytes));
>>          String encodedString = java.net.URLEncoder.encode(encode);
>>
>>          output.send(0, new StringToken(encodedString));
>>
>>      }
>>
>> My problem is that the encoded file is truncated by the actor and
>> hence not usable for further processing. There seems to be a limit of
>> 20 000 array elements (bytes), which is not sufficient for my purpose.
>> Does anyone have an idea why the file is chopped off after 20k letters?
>>
>> Thanks in advance,
>> Stefan
>>
>> _______________________________________________
>> Kepler-users mailing list
>> Kepler-users at kepler-project.org
>> http://lists.nceas.ucsb.edu/kepler/mailman/listinfo/kepler-users



More information about the Kepler-users mailing list