/* PrintHttpRequestFixed.java -- HTTPの要求を画面に表示する(枠組みだけ) ~yas/syspro/ipc/PrintHttpRequestFixed.java Created on 2015/08/18 14:38:02 */ import java.io.*; class PrintHttpRequestFixed { public static void main(String argv[]) throws IOException { http_send_request( stdout ); } public static void http_send_request( OutputStream out ) throws IOException { /* この関数の内容を変更しなさい。 "Change this\n" の部分を変更しなさい。 System.out を使わないで printOS() を使いなさい。 必要なパラメタは、引数から取る。System.in は使わない。 */ printfOS( out, "Change this\n"); } public static int printfOS( OutputStream out, String format, Object ... args ) throws IOException { String s = String.format( format, args ); return( putStringOS( out, s ) ); } public static int putStringOS( OutputStream out, String message ) throws IOException { byte b[] = message.getBytes(); out.write( b ); out.flush(); return( b.length ); } static java.io.BufferedReader stdin = new java.io.BufferedReader( new java.io.InputStreamReader(System.in) ); static java.io.PrintStream stdout = System.out; static java.io.PrintStream stderr = System.err; }