Java: get InputStream out of an InputStreamReader

Is it possible to get an InputStream out of an InputStreamReader instance? If yes, how?

EDIT: i'm reading a binary file over network, so i need to read bytes, not chars. I haven't found a way to do this with an InputStreamReader....

Jon Skeet
people
quotationmark

Not without reflection, no... and I really wouldn't recommend using reflection here. (You would be very implementation-specific.)

Usually you shouldn't care about which implementation of Reader is being used at all, so you wouldn't even know it was an InputStreamReader... let alone try to get access to the underlying InputStream.

people

See more on this question at Stackoverflow