[Date Prev][Date Next]
[Chronological]
[Thread]
[Top]
Re: byte[] v String and related comments (WG last call on the JavaAPI)
"Kurt D. Zeilenga" wrote:
>
> The API appears to provide similiar methods for both
> String and byte[] arguments, depending on if the
> caller knows the returned value is UTF-8, hence
> convertible to UCS-2 String, or rather just deal
> with raw octetStrings. However, I note that there
> are cases where there methods supporting String[]
> arguments, but not byte[][] arguments.
>
> For example, there are:
> public LDAPAttribute(String attrName, byte[] attrBytes)
> public LDAPAttribute(String attrName, String attrString)
> public LDAPAttribute(String attrName, String[] attrStrings)
>
> but there is no method support byte[][].
It's a little awkward dealing with byte[] in arrays in Java because they are not objects (don't extend Object) as String and Java objects do. Leaving out byte[][] methods was a reflection on usefulness. Is there a reason other than symmetry to include them?
> Also, I believe LDAPAttribute(String attrName) description
> should contain a comment that an attribute with no value
> can not be transferred by the protocol and any attempt to
> do so should cause an API error.]
Is it not legal to pass an attribute with no value in a modification (to remove all values of the attribute)?
Rob