Blackberry JAVA DEVELOPMENT ENVIRONMENT - - CRYPTOGRAPHIC SMART CARD DRIVER - DEVELOPMENT GUIDE Guia de Resolução de Problemas Página 223

  • Descarregar
  • Adicionar aos meus manuais
  • Imprimir
  • Página
    / 286
  • Índice
  • MARCADORES
  • Avaliado. / 5. Com base em avaliações de clientes
Vista de página 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
Vista de página 222
1 2 ... 218 219 220 221 222 223 224 225 226 227 228 ... 285 286

Comentários a estes Manuais

Sem comentários