أنشئ حسابًا أو سجّل الدخول للانضمام إلى مجتمعك المهني.
Yes, You can use both, but make sure the data you are retriving back.
printwriter is being used for char based data outpur like data from database. It is also do a unicode char conversion.
for bit streams like getting images you should use serveroutputstream.