code: public static int bestBufferSize( long fileSize ) {
          assert fileSize >= 0;
          if (fileSize < TINY_FILE_SIZE) {
              return (int)fileSize + 2;
          }
          if (fileSize < SMALL_FILE_SIZE) {
              return TINY_BUFFER_SIZE;
          }
          if (fileSize < MEDIUM_FILE_SIZE) {
              return SMALL_BUFFER_SIZE;
          }
          if (fileSize < LARGE_SIZE) {
              return MEDIUM_BUFFER_SIZE;
          }
          return LARGE_BUFFER_SIZE;
      }
docs: Given a number of bytes representing the length of a file, returns the optimum size for a buffer that should be used
  when reading/working with that file
  
  @param fileSize the size of a file, in bytes
  @return the size of a read/write buffer