我现在有个二进制数据文件,比如该数据文件包含2行2列的数据,分别为第一行为1和2,第二行为3和4.
我想在JSP文件中的<% %>中插入程序代码,获得某行某列的数据值,并用<tr><td>value<td><tr>显示在页面中,
请高手指点,最好能有相应的程序代码。我尝试用以下代码处理,但网页中显示的是类似于“[B@a998c1”这样的值。
<%
byte[] a = new byte[1];
int line=1;
int colum=0;
try {
  File fileRead = new("d:\a.dat");
  FileInputStream fileInStream = new FileInputStream(fileRead);
  long numSkip=line*2+colum;
  fileInStream.skip(numSkip);
  fileInStream.read(a);
  fileInStream.close();
} catch (IOException e) {
  out.println(e.toString());
}
%>
<tr><td><%=a%></td></tr>