summaryrefslogtreecommitdiffstats
path: root/obex/javax/obex/HeaderSet.java
diff options
context:
space:
mode:
Diffstat (limited to 'obex/javax/obex/HeaderSet.java')
-rw-r--r--obex/javax/obex/HeaderSet.java23
1 files changed, 23 insertions, 0 deletions
diff --git a/obex/javax/obex/HeaderSet.java b/obex/javax/obex/HeaderSet.java
index 2b3066f..51b560a 100644
--- a/obex/javax/obex/HeaderSet.java
+++ b/obex/javax/obex/HeaderSet.java
@@ -1,4 +1,5 @@
/*
+ * Copyright (c) 2014 The Android Open Source Project
* Copyright (c) 2008-2009, Motorola, Inc.
*
* All rights reserved.
@@ -181,6 +182,8 @@ public final class HeaderSet {
private String mName; // null terminated Unicode text string
+ private boolean mEmptyName;
+
private String mType; // null terminated ASCII text string
private Long mLength; // 4 byte unsigend integer
@@ -235,6 +238,25 @@ public final class HeaderSet {
}
/**
+ * Sets flag for special "value" of NAME header which should be empty. This
+ * is not the same as NAME header with empty string in which case it will
+ * have length of 5 bytes. It should be 3 bytes with only header id and
+ * length field.
+ */
+ public void setEmptyNameHeader() {
+ mName = null;
+ mEmptyName = true;
+ }
+
+ /**
+ * Gets flag for special "value" of NAME header which should be empty. See
+ * above.
+ */
+ public boolean getEmptyNameHeader() {
+ return mEmptyName;
+ }
+
+ /**
* Sets the value of the header identifier to the value provided. The type
* of object must correspond to the Java type defined in the description of
* this interface. If <code>null</code> is passed as the
@@ -269,6 +291,7 @@ public final class HeaderSet {
if ((headerValue != null) && (!(headerValue instanceof String))) {
throw new IllegalArgumentException("Name must be a String");
}
+ mEmptyName = false;
mName = (String)headerValue;
break;
case TYPE: