Jimmy Zhang:
>I am looking for ways to read data into a long array from data input stream
>directly. I feel that wrapping Fileinputstream
>using DataInputStream filter is kinda inefficient, if there is a way to let
>the datainputstream to arrange 8 bytes into a long directly, it wouild be
>really nice.
Why do you think it's not efficient? It's a normal approach in Java to
wrap I/O objects into other I/O objects. Just try the
DataInputStream/FileInputStream combination. However, make sure you
also include a buffering stream:
DataInput in = new DataInputStream(new BufferedInputStream(new
FileInputStream("file.dat")));
long l1 = in.readLong();
long l2 = in.readLong();
....
Regards,
Marco
--
Please reply in the newsgroup, not by email!
Java programming tips:
http://jiu.sourceforge.net/javatips.html
Other Java pages:
http://www.geocities.com/marcoschmidt.geo/java.html