CLDC+MIDP+携帯電話用Javaスレッド part 4
at TECH
667:デフォルトの名無しさん
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
4955日前に更新/291 KB
担当:undef