Lines Matching refs:value

117         // n + 1                 '='                   optional   separator of key and value
118 // n + 2 - record size uninterpreted bytes optional value
133 // recordLen is an unsigned 8 bit value
145 // Decode key-value records
147 byte[] value = null;
156 if (value == null) {
157 value = new byte[recordLen - key.length() - 1];
159 value[valueLen] = txtRecordsRawBytes[i];
179 setAttribute(key, value);
189 public void setAttribute(String key, byte[] value) {
204 // Key length + value length must be < 255.
205 if (key.length() + (value == null ? 0 : value.length) >= 255) {
206 throw new IllegalArgumentException("Key length + value length must be < 255 bytes");
217 int futureSize = txtRecordSize + key.length() + (value == null ? 0 : value.length) + 2;
224 mTxtRecord.put(key, value);
228 * Add a service attribute as a key/value pair.
233 * be UTF-8 strings or null. The total length of key + value must be less than 255 bytes.
237 * first value.
239 public void setAttribute(String key, String value) {
241 setAttribute(key, value == null ? (byte []) null : value.getBytes("UTF-8"));
265 txtRecordSize += 2; // One for the length byte, one for the = between key and value.
267 byte[] value = entry.getValue();
268 txtRecordSize += value == null ? 0 : value.length;
284 byte[] value = entry.getValue();
286 // One byte to record the length of this key/value pair.
287 txtRecord[ptr++] = (byte) (key.length() + (value == null ? 0 : value.length) + 1);
299 // The value, as any raw bytes.
300 if (value != null) {
301 System.arraycopy(value, 0, txtRecord, ptr, value.length);
302 ptr += value.length;
340 // TXT record key/value pairs.
343 byte[] value = mTxtRecord.get(key);
344 if (value != null) {
346 dest.writeInt(value.length);
347 dest.writeByteArray(value);
371 // TXT record key/value pairs.