FileDocCategorySizeDatePackage
UnicodeString.javaAPI DocJCIFS 1.3.17 API2043Tue Oct 18 15:26:24 BST 2011jcifs.dcerpc

UnicodeString

public class UnicodeString extends rpc.unicode_string

Fields Summary
boolean
zterm
Constructors Summary
public UnicodeString(boolean zterm)

        this.zterm = zterm;
    
public UnicodeString(rpc.unicode_string rus, boolean zterm)

        this.length = rus.length;
        this.maximum_length = rus.maximum_length;
        this.buffer = rus.buffer;
        this.zterm = zterm;
    
public UnicodeString(String str, boolean zterm)

        this.zterm = zterm;

        int len = str.length();
        int zt = zterm ? 1 : 0;

        length = maximum_length = (short)((len + zt) * 2);
        buffer = new short[len + zt];

        int i;
        for (i = 0; i < len; i++) {
            buffer[i] = (short)str.charAt(i);
        }
        if (zterm) {
            buffer[i] = (short)0;
        }
    
Methods Summary
public java.lang.StringtoString()

        int len = length / 2 - (zterm ? 1 : 0);
        char[] ca = new char[len];
        for (int i = 0; i < len; i++) {
            ca[i] = (char)buffer[i];
        }
        return new String(ca, 0, len);