NOTICE: This version of the NSF Unidata web site (archive.unidata.ucar.edu) is no longer being updated.
Current content can be found at unidata.ucar.edu.

To learn about what's going on, see About the Archive Site.

Re: java i/o

Randy Heiland wrote:
> 
> I copied/tweaked some VisAD code for reading/parsing input files.
> The boiled down code and input files (included) run fine on my SGI (running
> their latest jdk), but give me a java.lang.NumberFormatException on my NT box
> (with "Java 2").  See outputs at very end.
> 
> Write once, run anywhere?  Any suggestions?
> 

Since the output is different (the NT one includes a 'cr' character), 

> -----> tail of output on SGI
> hex[0][5]= 6
> [0]=55
> 32
> hex[0][6]= 7
> [0]=56
> 10
> hex[0][7]= 8
> 1=1,2,3,4,5,6,7,8
> 
> -----> on NT
> hex[0][5]= 6
> [0]=55
> 32
> hex[0][6]= 7
> [0]=56
> 13                      <==== 'cr' character
> 10
> Exception in ...
> 

it may be that you need to accomodate (skip?) that as well as 'lf'.  I did not
read your code in detail, but when I saw:

>         while ( (ints[l] != 32) && (ints[l] != 10) ) {

I got suspicious...hope that helps.

tom

> 

--
Tom Whittaker  (tomw@xxxxxxxxxxxxx)
University of Wisconsin-Madison
Space Science and Engineering Center
Phone/Voicemail: 608/262-2759  
Fax: 608/263-6738

  • References:
  • 1998 messages navigation, sorted by:
    1. Thread
    2. Subject
    3. Author
    4. Date
    5. ↑ Table Of Contents
  • Search the visad archives: