Jim LaGrone <[email protected]> wrote on 07/27/2009 04:30:08 PM:
> Is there an API available for classes such as FileReader? I get the
> message
>
> No valid method call found for read(x10.lang.Rail[x10.lang.Byte],
> x10.lang.Int{self==0},
> x10.lang.Int{self==byteRail.x10.lang.Rail#length}) in x10.io.FileReader.
>
> with the following code:
>
> FileReader file(...);
> file.read( letterBytes, 0, letterBytes.length() );
>
> I've been trying to use the .x10 files in directory x10.runtime.17/src-
> x10/x10 as a road map, but this file i/o is not cooperating with my
> method.
Hi, Jim,
No, there is no API spec available at the moment -- you have to read
the source for now. We are working on a tool to produce Javadoc-style
web pages for the X10 library classes, but no ETA on that yet.
I believe the method you're looking for is
public final def read[T](m: Marshal[T], a: Rail[T], off: Int, len:
Int): Void throws IOException;
inherited from x10.io.Reader, which you'd use it as follows:
val file: FileReader = ...;
file.read(Marshal.BYTE, letterBytes, 0, letterBytes.length());
You can also use the read[T](Marshal[T], Rail[T]) helper method,
like this:
val file: FileReader = ...;
file.read(Marshal.BYTE, letterBytes);
Hope this helps,
Igor
--
Igor Peshansky (note the spelling change!)
IBM T.J. Watson Research Center
XJ: No More Pain for XML's Gain (http://www.research.ibm.com/xj/)
X10: Parallel Productivity and Performance (http://x10.sf.net/)
------------------------------------------------------------------------------
_______________________________________________
X10-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/x10-users