code: public static String readFileContents(FileSystem fs, Path path, int bufferSize)
              throws IOException {
          if(bufferSize <= 0)
              return new String();
  
          FSDataInputStream input = fs.open(path);
          byte[] buffer = new byte[bufferSize];
  
          ByteArrayOutputStream stream = new ByteArrayOutputStream();
  
          while(true) {
              int read = input.read(buffer);
              if(read < 0) {
                  break;
              } else {
                  buffer = ByteUtils.copy(buffer, 0, read);
              }
              stream.write(buffer);
          }
  
          return new String(stream.toByteArray());
      }
docs: Given a filesystem, path and buffer-size, read the file contents and
  presents it as a string
  
  @param fs Underlying filesystem
  @param path The file to read
  @param bufferSize The buffer size to use for reading
  @return The contents of the file as a string
  @throws IOException