public static final void logHeader(HeaderSet hs) { Log.v(TAG, "Dumping HeaderSet " + hs.toString()); try { Log.v(TAG, "COUNT : " + hs.getHeader(HeaderSet.COUNT)); Log.v(TAG, "NAME : " + hs.getHeader(HeaderSet.NAME)); Log.v(TAG, "TYPE : " + hs.getHeader(HeaderSet.TYPE)); Log.v(TAG, "LENGTH : " + hs.getHeader(HeaderSet.LENGTH)); Log.v(TAG, "TIME_ISO_8601 : " + hs.getHeader(HeaderSet.TIME_ISO_8601)); Log.v(TAG, "TIME_4_BYTE : " + hs.getHeader(HeaderSet.TIME_4_BYTE)); Log.v(TAG, "DESCRIPTION : " + hs.getHeader(HeaderSet.DESCRIPTION)); Log.v(TAG, "TARGET : " + hs.getHeader(HeaderSet.TARGET)); Log.v(TAG, "HTTP : " + hs.getHeader(HeaderSet.HTTP)); Log.v(TAG, "WHO : " + hs.getHeader(HeaderSet.WHO)); Log.v(TAG, "OBJECT_CLASS : " + hs.getHeader(HeaderSet.OBJECT_CLASS)); Log.v(TAG, "APPLICATION_PARAMETER : " + hs.getHeader(HeaderSet.APPLICATION_PARAMETER)); } catch (IOException e) { Log.e(TAG, "dump HeaderSet error " + e); } }
/** Function to send obex header back to client such as get phonebook size request */ private final int pushHeader(final Operation op, final HeaderSet reply) { OutputStream outputStream = null; if (D) Log.d(TAG, "Push Header"); if (D) Log.d(TAG, reply.toString()); int pushResult = ResponseCodes.OBEX_HTTP_OK; try { op.sendHeaders(reply); outputStream = op.openOutputStream(); outputStream.flush(); } catch (IOException e) { Log.e(TAG, e.toString()); pushResult = ResponseCodes.OBEX_HTTP_INTERNAL_ERROR; } finally { if (!closeStream(outputStream, op)) { pushResult = ResponseCodes.OBEX_HTTP_INTERNAL_ERROR; } } return pushResult; }