DinoAdor
September 29th, 1999, 11:03 PM
Greetings Gurus! I need help understanding this syntax:
ServletInputStream sis = req.getInputStream();
byte[]buf = new byte[4096];
sis.read(buf);
String name = new String(buf).trim().toUpperCase();
PrintWriter pw = res.getWriter();
It's really the 4th line that confuses me. I didnt know that syntax is legal. Could someone explain to me in detail 'String(buf).trim().toUpperCase()? In fact explaining the whole thing wouldnt hurt :). NOTE: I do know that the PrinterWriter object can be replaced by the ServletOutputStream object. I didnt know u can have a type byte[] variable. I need a clearer understanding of what this does.
Thanks!
Dino
ServletInputStream sis = req.getInputStream();
byte[]buf = new byte[4096];
sis.read(buf);
String name = new String(buf).trim().toUpperCase();
PrintWriter pw = res.getWriter();
It's really the 4th line that confuses me. I didnt know that syntax is legal. Could someone explain to me in detail 'String(buf).trim().toUpperCase()? In fact explaining the whole thing wouldnt hurt :). NOTE: I do know that the PrinterWriter object can be replaced by the ServletOutputStream object. I didnt know u can have a type byte[] variable. I need a clearer understanding of what this does.
Thanks!
Dino