Blackberry JAVA DEVELOPMENT ENVIRONMENT - - CRYPTOGRAPHIC SMART CARD DRIVER - DEVELOPMENT GUIDE Anleitung zur Fehlerbehebung Seite 223

  • Herunterladen
  • Zu meinen Handbüchern hinzufügen
  • Drucken
  • Seite
    / 286
  • Inhaltsverzeichnis
  • LESEZEICHEN
  • Bewertet. / 5. Basierend auf Kundenbewertungen
Seitenansicht 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
Seitenansicht 222
1 2 ... 218 219 220 221 222 223 224 225 226 227 228 ... 285 286

Kommentare zu diesen Handbüchern

Keine Kommentare