code: public static byte[] readAllBytes(java.nio.file.Path path) throws IOException {
  		try (SeekableByteChannel channel = Files.newByteChannel(path);
  			InputStream in = Channels.newInputStream(channel)) {
  
  			long size = channel.size();
  			if (size > (long) MAX_BUFFER_SIZE) {
  				throw new OutOfMemoryError("Required array size too large");
  			}
  
  			return read(in, (int) size);
  		}
  	}
docs: Reads all the bytes from a file. The method ensures that the file is
  closed when all bytes have been read or an I/O error, or other runtime
  exception, is thrown.
  
  <p>This is an implementation that follow {@link java.nio.file.Files#readAllBytes(java.nio.file.Path)},
  and the difference is that it limits the size of the direct buffer to avoid
  direct-buffer OutOfMemoryError. When {@link java.nio.file.Files#readAllBytes(java.nio.file.Path)}
  or other interfaces in java API can do this in the future, we should remove it.
  
  @param path
  the path to the file
  @return a byte array containing the bytes read from the file
  
  @throws IOException
  if an I/O error occurs reading from the stream
  @throws OutOfMemoryError
  if an array of the required size cannot be allocated, for
  example the file is larger that {@code 2GB}