Вопрос

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....

Это было полезно?

Решение

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.

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top