Subj : Re: OutputStream Problem To : N.Ruhrus@Alphasoft-GmbH.de From : Igor Bukanov Date : Tue Sep 23 2003 06:15 pm Normen Ruhrus wrote: > Hi there, > > got the following Script and got the Error Message: > Could someone please tell me how to write this correct, so that it is > understandable for Rhino? It seems to be a bug in Rhino preventing selection of the propep method among overloaded candidates. Can you file a bug at bugzilla.mozilla.org about it? As a workaround you can tell Rhino exactly which function you are going to use and replace out.write(test.getBytes()); by out['write(byte[])'](test.getBytes()); See http://www.mozilla.org/js/liveconnect/lc3_method_overloading.html#ExplicitMethod for details how to write explicit method specification. Regards, Igor > > Thanks alot in advance > > Normen > <23-Sep-2003 12:14:02> > :C_SocketDevice.run():org.mozilla.javascript.EvaluatorException: The choice > of Java method java.io.FileOutputStream.write matching JavaScript argument > types (byte[]) is ambiguous; candidate methods are: void write(int), void > write(byte[]) (devtest; line 12) > > > //Globals > var test = new java.lang.String("JavaScript"); > > //Hauptteil > while(true) > { > var sock = Server.accept(); > var out = sock.getOutputStream(); > out.write(test.getBytes()); > sock.close(); > } > > .