CLDC+MIDP+携帯電話用Javaスレッド part 4at TECH
CLDC+MIDP+携帯電話用Javaスレッド part 4 - 暇つぶし2ch667:デフォルトの名無しさん
05/08/20 02:11:45
 public void doHttp() {
  byte[] buf = null;
  HttpConnection http = null;
  OutputStream out = null;
  InputStream in = null;
  ByteArrayOutputStream baos = null;
  String resMsg;
  in resCode
  try {
   http = (HttpConnection)Connector.open( "URLリンク(xxxxxxxx)" ); // 自宅サーバURL
   http.setRequestMethod( HttpConnection.POST ); // GET HEADでも確認
   long time = http.getDate() ;
   in = http.openInputStream();
   resCode = http.getResponseCode();
   int contentLength = (int)http.getLength();
   buf = new byte[1024];
   baos = new ByteArrayOutputStream();
   int len = 0;
   while ( ( len = in.read( buf ) ) != -1 ) {
    baos.write( buf, 0, len );
   }
   baos.close();
   buf = null;



次ページ
続きを表示
1を表示
最新レス表示
レスジャンプ
類似スレ一覧
スレッドの検索
話題のニュース
おまかせリスト
オプション
しおりを挟む
スレッドに書込
スレッドの一覧
暇つぶし2ch