I'd like to translate the following pice of code from Java to Ceylon and while it compiles just fine, it throws a ClassCastException at runtime.
Java:
byte[] fileData = new byte[fileLength];
FileInputStream fileIn = new FileInputStream(file);
fileIn.read(fileData);
Ceylon:
Array<Integer> fileData = arrayOfSize<Integer>(fileLength, 0);
value fileIn = FileInputStream(file);
fileIn.read(fileData);
Ceylon version results in the following exception at runtime:
Exception in thread "Thread-0" java.lang.ClassCastException: [J cannot be cast to [B
at com.zt.HTTPServer.run(classes.ceylon:59)
at java.lang.Thread.run(Thread.java:722)
Is there a trick that I've missed or is it a bug that I've hit?
Thanks,
Anton
--
You received this message because you are subscribed to the Google Groups "ceylon-dev" group.
To view this discussion on the web visit https://groups.google.com/d/msg/ceylon-dev/-/MxPGLUTEWrYJ.
To post to this group, send email to ceylo...@googlegroups.com.
To unsubscribe from this group, send email to ceylon-dev+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/ceylon-dev?hl=en.
I'd like to translate the following pice of code from Java to Ceylon and while it compiles just fine, it throws a ClassCastException at runtime.
Java:
byte[] fileData = new byte[fileLength];
FileInputStream fileIn = new FileInputStream(file);
fileIn.read(fileData);
Ceylon:
Array<Integer> fileData = arrayOfSize<Integer>(fileLength, 0);
value fileIn = FileInputStream(file);
fileIn.read(fileData);
Ceylon version results in the following exception at runtime:
Exception in thread "Thread-0" java.lang.ClassCastException: [J cannot be cast to [B
at com.zt.HTTPServer.run(classes.ceylon:59)
at java.lang.Thread.run(Thread.java:722)
Is there a trick that I've missed or is it a bug that I've hit?
Thanks,
Anton
--
You received this message because you are subscribed to the Google Groups "ceylon-dev" group.
To view this discussion on the web visit https://groups.google.com/d/msg/ceylon-dev/-/MxPGLUTEWrYJ.
To post to this group, send email to ceylo...@googlegroups.com.
To unsubscribe from this group, send email to ceylon-dev+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/ceylon-dev?hl=en.
To unsubscribe from this group and stop receiving emails from it, send an email to ceylon-dev+...@googlegroups.com.
Visit this group at http://groups.google.com/group/ceylon-dev?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.