Patrick LeBoutillier wrote:
>Jason,
>
>I see what's going on. The problem is that a byte in Perl has range
>0-255, but a byte in Java has range -128-127. That's why Inline::Java
>is telling you that the values you are passing are out of range.
>
>Inline::Java should probably do this kind of conver
Jason,
I see what's going on. The problem is that a byte in Perl has range
0-255, but a byte in Java has range -128-127. That's why Inline::Java
is telling you that the values you are passing are out of range.
Inline::Java should probably do this kind of conversion automatically
for you, but for
On Sep 22, 2005, at 8:40 PM, Patrick LeBoutillier wrote:
Jason,
Have you tried something like this:
I have. I've attached some very similar code that I've tried just to
get things working. I agree that splitting a (potentially large)
string into bytes is expensive, but if that works I'l
Jason,
Have you tried something like this:
use strict ;
use warnings ;
use Inline (
Java => 'DATA',
STUDY => ['java.io.ByteArrayOutputStream'],
) ;
my $os = new java::io::ByteArrayOutputStream() ;
my $scalar = "test\n" ;
print $scalar ;
my @bytes = map {ord($_)} split(''
Patrick LeBoutillier wrote:
>Suppose you call a Java method (from Perl) that returns a String. What
>does Inline::Java do with the String? It nicely converts it to a Perl
>scalar for you and allows you to forget all about the String object.
>Unfortunately that exactly what is happening here also :
Jason,
Although the idea is good, what your trying to do can't work. And when
you think about it it's actually really simple.
Suppose you call a Java method (from Perl) that returns a String. What
does Inline::Java do with the String? It nicely converts it to a Perl
scalar for you and allows you