<%@ page import="java.io.*" %>
Reading Binary Data
Reading Binary Data
This page reads binary data from a file.
Read this data:
<%
String file = application.getRealPath("/") + "test.dat";
FileInputStream fileinputstream = new FileInputStream(file);
int numberBytes = fileinputstream.available();
byte bytearray[] = new byte[numberBytes];
fileinputstream.read(bytearray);
for(int i = 0; i < numberBytes; i++){
out.println(bytearray[i]);
}
fileinputstream.close();
%>