code: public long getReadSize(SectionHeader header) {
          Preconditions.checkNotNull(header);
          long pointerToRaw = header.get(POINTER_TO_RAW_DATA);
          long virtSize = header.get(VIRTUAL_SIZE);
          long sizeOfRaw = header.get(SIZE_OF_RAW_DATA);
          long alignedPointerToRaw = header.getAlignedPointerToRaw();
          // see Peter Ferrie's answer in:
          // https://reverseengineering.stackexchange.com/questions/4324/reliable-algorithm-to-extract-overlay-of-a-pe
          long readSize = fileAligned(pointerToRaw + sizeOfRaw)
                  - alignedPointerToRaw;
          readSize = Math.min(readSize, header.getAlignedSizeOfRaw());
          // see https://code.google.com/p/corkami/wiki/PE#section_table:
          // "if bigger than virtual size, then virtual size is taken. "
          // and:
          // "a section can have a null VirtualSize: in this case, only the SizeOfRawData is taken into consideration. "
          if (virtSize != 0) {
              readSize = Math.min(readSize, header.getAlignedVirtualSize());
          }
          readSize = fileSizeAdjusted(alignedPointerToRaw, readSize);
          // must not happen
          if (readSize < 0) {
              logger.error("Invalid readsize: " + readSize + " for file "
                      + file.getName() + " adjusting readsize to 0");
              readSize = 0;
          }
          assert readSize >= 0;
          return readSize;
      }
docs: Determines the number of bytes that is read for the section.
  <p>
  This is the actual section size.
  
  @param header
  header of the section
  @return section size
  @throws IllegalArgumentException
  if header is null