summaryrefslogtreecommitdiff
path: root/usergrps/uktug/baskervi/6_4/java-io.tex
blob: d7296d73c99beadb21c8fc0954e0d7e239606112 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%% this figure relates to something a little later on; placed here to
%%% force it to come atop the proper case
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{figure*}[htp]
\begin{verbatim}
    function signed_pair:integer; {returns the next two bytes, signed}
    var a,@!b:eight_bits;
    begin a:=0; b:=0; 
    try begin a:=dvi_file.readByte; b:=dvi_file.readUnsignedByte; end;
    catch (ex: IOException) EOF_dvi_file:=true;
    if EOF_dvi_file then signed_pair:=0
    else begin cur_loc:=cur_loc+2; signed_pair:=a*256+b; end;
    end;
\end{verbatim}
\caption{Mapping of ordinary input from file in Java}
\label{fig:exceptions-io}
\end{figure*}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%