Source Code : Reading Binary Data
Java Is Open Source Programming Language You Can Download From Java and Java Libraries From http://www.oracle.com.
Click Here to download
We provide this code related to title for you to solve your developing problem easily. Libraries which is import in this program you can download from http://www.oracle.com.
Click Here or search from google with Libraries Name you get jar file related it
Reading Binary Data
<%@ page import="java.io.*" %>
<HTML>
<HEAD>
<TITLE>Reading Binary Data</TITLE>
</HEAD>
<BODY>
<H1>Reading Binary Data</H1>
This page reads binary data from a file.
<BR>
Read this data:
<BR>
<BR>
<%
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();
%>
</BODY>
</HTML>
Thank with us