code: public static ByteBuffer readFile(File inFile) throws IOException {
          ByteBuffer mBuf;
          try (FileInputStream fIn = new FileInputStream(inFile);
               FileChannel fChan = fIn.getChannel()) {
              long fSize = fChan.size();
              mBuf = ByteBuffer.allocate((int) fSize);
              fChan.read(mBuf);
              mBuf.rewind();
          }
          return mBuf;
      }
docs: Helper method to read a file into a ByteBuffer
  
  @param inFile File to read from
  @return ByteBuffer containing the contents of the file
  @throws IOException Thrown if there was a problem reading the file