protected void loadBuffer(){
  int resIdx=minuteSpacing / 5 - 1;
  if (resIdx < 0)   resIdx=0;
 else   if (resIdx > 2)   resIdx=2;
  String fileName=path + etopoFileNames[resIdx];
  try {
    BufferedInputStream bis=new BufferedInputStream(ClassLoader.getSystemResourceAsStream(fileName));
    bufferWidth=etopoWidths[resIdx];
    bufferHeight=etopoHeights[resIdx];
    int spacer=1;
switch (minuteSpacing) {
case (2):
      spacer=1 + this.spacer;
    break;
case (5):
  spacer=0 + this.spacer;
break;
default :
spacer=1 + this.spacer;
}
int numberOfWords=(bufferWidth + spacer) * bufferHeight;
dataBuffer=new short[numberOfWords];
iv_buffer=new byte[2 * numberOfWords];
iv_bytesinbuffer=bis.read(iv_buffer,0,2 * numberOfWords);
iv_curptr=0;
for (int i=0; i < bufferWidth * bufferHeight; i++) dataBuffer[i]=readShort();
bis.close();
bufferWidth+=spacer;
}
 catch (FileNotFoundException e) {
Debug.error("ETOPOLayer loadBuffer(): file " + fileName + " not found");
}
catch (IOException e) {
Debug.error("ETOPOLayer loadBuffer(): File IO Error!\n" + e.toString());
}
}

protected void loadBuffer ( ) { int resIdx = minuteSpacing / 5 - 1 ; if ( resIdx < 0 ) resIdx = 0 ; else if ( resIdx > 2 ) resIdx = 2 ; String fileName = path + etopoFileNames [ resIdx ] ; try { BufferedInputStream bis = new BufferedInputStream ( ClassLoader . getSystemResourceAsStream ( fileName ) ) ; bufferWidth = etopoWidths [ resIdx ] ; bufferHeight = etopoHeights [ resIdx ] ; int spacer = 1 ; switch ( minuteSpacing ) { case ( 2 ) : spacer = 1 + this . spacer ; break ; case ( 5 ) : spacer = 0 + this . spacer ; break ; default : spacer = 1 + this . spacer ; } int numberOfWords = ( bufferWidth + spacer ) * bufferHeight ; dataBuffer = new short [ numberOfWords ] ; iv_buffer = new byte [ 2 * numberOfWords ] ; iv_bytesinbuffer = bis . read ( iv_buffer , 0 , 2 * numberOfWords ) ; iv_curptr = 0 ; for ( int i = 0 ; i < bufferWidth * bufferHeight ; i ++ ) dataBuffer [ i ] = readShort ( ) ; bis . close ( ) ; bufferWidth += spacer ; } catch ( FileNotFoundException e ) { Debug . error ( "ETOPOLayer loadBuffer(): file " + fileName + " not found" ) ; } catch ( IOException e ) { Debug . error ( "ETOPOLayer loadBuffer(): File IO Error!\n" + e . toString ( ) ) ; } }
loads the database from the appropriate file based on the current resolution . the data files are in intel format ( must call binarybufferedfile . byteorder ( true ) ) .
