int readRowN ( DataInputStream ds , int n ) { if ( n > nrec ) return - 1 ; /* the assumption here is that the DataInputStream (ds) * is already pointing at the right spot! */ try { ds . readFully ( field , 0 , desc . FieldLength ) ; } catch ( java . io . IOException e ) { return - 1 ; } switch ( desc . Type ) { case ' ' : case ' ' : character [ n ] = new String ( field , CDM . utf8Charset ) ; break ; case ' ' : numeric [ n ] = Double . valueOf ( new String ( field , CDM . utf8Charset ) ) ; break ; case ' ' : /* binary floating point */ if ( desc . FieldLength == 4 ) { numeric [ n ] = ( double ) Swap . swapFloat ( field , 0 ) ; } else { numeric [ n ] = Swap . swapDouble ( field , 0 ) ; } break ; case ' ' : switch ( field [ 0 ] ) { case ' ' : case ' ' : case ' ' : case ' ' : logical [ n ] = true ; break ; default : logical [ n ] = false ; break ; } default : return - 1 ; } return 0 ; }
Method to read an entry from the data stream . The stream is assumed to be in the right spot for reading . This method should be called from something controlling the reading of the entire file .