How to upload binary document in Java API

Hi,
Newbie question - sorry if this is already answered.

Looking for more detailed Java doc for uploading binary document
(mainly MS Office and PDF).
I get the data from InputStream, how to pass to ES?

many thanks
canal