webax Posted January 30, 2009 Posted January 30, 2009 hello (sorry, I'm french and don't speak English very well) I test scriptmaster, and I want to copy one file in other directory from my filemaker server/IWP I write this code java.io.FileInputStream sourceFile=null; java.io.FileOutputStream destinationFile=null; new File(destination).createNewFile(); sourceFile = new java.io.FileInputStream(source); destinationFile = new java.io.FileOutputStream(destination); byte buffer[]=new byte[512*1024]; int nbLecture; while( (nbLecture = sourceFile.read(buffer)) != -1 ) { destinationFile.write(buffer, 0, nbLecture); } but scriptmaster return an error about the type "BYTE": org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed, Script1.groovy: 11: Primitive type literal: byte cannot be used as a method name at line: 11 column: 1. File: Script1.groovy @ line 11, column 1. anyone had any idea about this problem ? thanks a lot !
David Wikström Posted January 31, 2009 Posted January 31, 2009 Je ne connais pas trop le java mais à ce que je peux comprendre, vous avez utilisé un mot réservé - "byte" pour nommer la commande envoyé. Je ne vous garantis rien, mais essayez de changer la ligne: byte buffer[]=new byte[512*1024]; en (par exemple) ByteBuffer buffer[]=new byte[512*1024];
webax Posted January 31, 2009 Author Posted January 31, 2009 Je ne connais pas trop le java mais à ce que je peux comprendre, vous avez utilisé un mot réservé - "byte" pour nommer la commande envoyé. Je ne vous garantis rien, mais essayez de changer la ligne: byte buffer[]=new byte[512*1024]; en (par exemple) ByteBuffer buffer[]=new byte[512*1024]; Finalement il s'agissait de la définition du tableau, elle se faisait sur le "byte" directement byte[] buffer=new byte[512*1024]; merci
Recommended Posts
This topic is 5786 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now