Blackberry JAVA DEVELOPMENT ENVIRONMENT - - CRYPTOGRAPHIC SMART CARD DRIVER - DEVELOPMENT GUIDE Instrukcja Naprawy Strona 223

  • Pobierz
  • Dodaj do moich podręczników
  • Drukuj
  • Strona
    / 286
  • Spis treści
  • BOOKMARKI
  • Oceniono. / 5. Na podstawie oceny klientów
Przeglądanie stron 222
223
15: Creating push applications
Read the server response. 1. To access an input stream, invoke getInputStream().
InputStream ins = conn.getInputStream();
2. Determine the size of the content. If the size of the content is non zero, open a data input
stream, and then retrieve the content.
int contentLength = conn.getContentLength();
if (contentLength > 0) {
byte[] someArray = new byte [contentLength];
DataInputStream dins = new DataInputStream(ins);
dins.readFully(someArray);
System.out.println(new String(someArray));
}
ins.close();
Close the server connection. > To indicate that the application will make no further requests to the server, invoke
disconnect()
conn.disconnect();
Task Steps
Przeglądanie stron 222
1 2 ... 218 219 220 221 222 223 224 225 226 227 228 ... 285 286

Komentarze do niniejszej Instrukcji

Brak uwag