private static int readFromCurrent(WFFileConnection fc, byte[] b, int size, int position) throws IOException {
         openAndBufferIfNeeded(fc);
         int count = 0;
         if (HEADER_BUFFER) {
             if (position < headerBufferSize) {
                 //we can read something
                 count = Math.min(size, headerBufferSize - position);
                 System.arraycopy(headerBuffer, position, b, 0, count);
             } //else nothing to read from the buffer 
             
             if (headerBufferSize < headerBuffer.length) {
                 if(LOG.isWarn()) {
                    LOG.warn("FileHandler.readFromCurrent()", "The file is smaller than buffer");
                }
                 
                 //we have reached end of file
                 return count;//no point to try to read more  
             } 
         }
         
         if (count < size) {
             //fill directly from the from the file the entire buffer or the rest
             //remaining 
             if (seekCurrentFile(position + count)) {
                startPeriod();
                int n = currentFileIs.read(b, count, size - count);
                logPeriod("read", n);
                count += n;
                currentPosition += n;
            } else {
                if(LOG.isWarn()) {
                    LOG.warn("FileHandler.readFromCurrent()", "Could not seek the file is too small");
                }
            }
         } 
         return count;
     }