Android chromecast api are in java..so in the theory they could be used in arbitrary java programs...am I correct?
My intention would be to build a chromecast streaming server in java, so to stream local files.
If you intend to use Cast APIs, you will not be able to do that; most of the functionality is in the Google Play services.