From: zuo j. <zu...@pk...> - 2006-03-21 10:10:41
|
Thank your advice! I considered moving the implementation of parsing = into a peer method. But several reasons prohibited me to do so. The main reason = is that the Rule objects constructed out of parsing have to interact with = the module running in JPF in complex manner. So, I decide to try RandomAccessFile. When I use RandomAccessFile.read(byte[] data, =A1=AD) = to read the file, UnsatisfiedLink error disappears. However, the read bytes = cannot be transformed to String. The code is:=20 RandomAccessFile rf =3D new CharRandomAccessFile(file, "r"); byte [] data =3D new byte[4*1024]; rf.read(data, 0, data.length); String s =3D new String(data); System.out.println(s); However, the output to screen is invisible. Note String(byte[]) is to = decode bytes with default charset name. Is there a simple approach to transform = the bytes to String? Or, do we have to implement a new peer method to read = file into a char array? |