public void loadTracesToFESVo(int sourceID)
    {
        int sizeOfExtendedHeaders = 
                readShort(SEGY.SEGY_NUM_OF_EXTENDED_TEXTUAL_FILE_HEADER_BYTE_NUM)
                * SEGY.SEGY_TEXTUAL_HEADER_SIZE;
        
        int sizeOfAllHeaders = SEGY.SEGY_TEXTUAL_HEADER_SIZE
                             + SEGY.SEGY_BINARY_HEADER_SIZE
                             + sizeOfExtendedHeaders;
        
        int traceDataSize = this.samplesPerTrace * this.sampleSize;          
        
        FileInputStream inStream = null;
        
        try
        {
            inStream = new FileInputStream(this.file);

            // skip over all headers:
            inStream.skip(sizeOfAllHeaders);
            
            // a byte array to hold current trace data:
//            byte [] traceB = new byte[traceDataSize];
            
            // a ByteBuffer to obtain an integer:
            ByteBuffer buffer;
            int numOfBytesReturned;
            
            // number of bytes storing X and Y Coordinates in SEGY file
            int length = 4;
            
            // byte arrays to hold X and Y coordinate bytes from file:
            byte [] bX = new byte[length];
            byte [] bY = new byte[length];
            
            // X and Y Coordinate of current trace:
            int coordX, coordY;
            
            // an index to indicate current trace number within SEGY
            int i=0; 
            
            // Trace object for current trace:
//            Trace trace;
            
            
            // read traces till end of segy file:
            while (true)
            {
                // read x, y location of this trace:
                // Note: read directly using this method's inStream 
                // instead of readInt() method as this will re-open the file:
                
                // skip over a number of bytes based on required location:
                inStream.skip(SEGY.SEGY_TRACE_X_COORDINATE_BYTE_NUM-1); // address = location - 1

                // read the required bytes storing X coordinates:
                numOfBytesReturned = inStream.read(bX);

                // exit while loop if it's end of thie file:
                if (numOfBytesReturned == -1)
                    break;
                
                // update trace index:
                i++;
                
                // throw exception if returned value is not the required size:
                if (numOfBytesReturned != length)
                    throw new Exception("Error in reading header of trace no. " + i);
                
                // read the required bytes storing Y coordinates:
                // no need to skip as Y coordinates bytes should come immidiatly after X coordinates bytes
                numOfBytesReturned = inStream.read(bY);

                // throw exception if returned value is not the required size:
                if (numOfBytesReturned != length)
                    throw new Exception("Error in reading header of trace no. " + i);
                
                // get X coordinate this trace:
                buffer = ByteBuffer.wrap(bX);
                coordX = buffer.getInt();
                
                // get Y coordinate this trace:
                buffer = ByteBuffer.wrap(bY);
                coordY = buffer.getInt();
                
                
                // skip through trace header taking into account current location:
                inStream.skip(SEGY.SEGY_TRACE_HEADER_SIZE - SEGY.SEGY_TRACE_X_COORDINATE_BYTE_NUM - (length*2) +1);
                
                // a byte array to hold current trace data:
                byte [] traceB = new byte[traceDataSize];
            
            
                // read trace data bytes:
                numOfBytesReturned = inStream.read(traceB);
                
                // throw exception if returned value is not the required size:
                if (numOfBytesReturned != traceDataSize)
                    throw new Exception("Error in reading trace no. " + i);
                
                
                // Byte order in SEGY is "big-endian", 
                // but OpenGL requires "little-endian" 
                // and cann't use Java order() method
                // so now swap byte order: (only supporting 4-byte data)
                for (int j=0; j < traceB.length; j+= 4)
                {
                    // swap bytes 0 and 3:
                    byte temp = traceB[j+3];
                    traceB[3+j] = traceB[j];
                    traceB[j] = temp;

                    // swap bytes 1 and 2
                    temp = traceB[2+j];
                    traceB[2+j] = traceB[1+j];
                    traceB[1+j] = temp;
                }//for
                
                
                // create a Trace object for this trace:
                Trace trace = new Trace(coordX, coordY, sourceID);
                trace.setSamples(traceB);
                
                // put trace into FESVo data map:
                FESVo.putTrace(trace);
                
            }//while
                        
            // closing:
            inStream.close();
            
            // update FESVo with meta-data of this SEGY:
            FESVo.setMetadata(
                    sourceID, new SeismicMetadata(  getSamplesPerTrace(),
                                                    getSampleDataFormat(),
                                                    getSampleInterval(),
                                                    getTimeMin(),
                                                    getTimeMax()));
            
            // [TESTING]
            System.out.println(i + " traces were loaded into FESVo.");
            
        }//try

        catch(Exception ex){
            System.err.println(ex);
        }
    }