/** Return the Utf8 representation of this name. */ public byte[] toUtf() { byte[] bs = new byte[getByteLength()]; getBytes(bs, 0); return bs; }
/** Return the concatenation of all names in the array `ns'. */ public static Name concat(Table table, Name ns[]) { int len = 0; for (int i = 0; i < ns.length; i++) len = len + ns[i].len; byte[] bs = new byte[len]; len = 0; for (int i = 0; i < ns.length; i++) { ns[i].getBytes(bs, len); len = len + ns[i].len; } return fromUtf(table, bs, 0, len); }
/** Return the Utf8 representation of this name. */ public byte[] toUtf() { byte[] bs = new byte[getByteLength()]; getBytes(bs, 0); return bs; }
/** Return the concatenation of all names in the array `ns'. */ public static Name concat(Table table, Name ns[]) { int len = 0; for (int i = 0; i < ns.length; i++) len = len + ns[i].len; byte[] bs = new byte[len]; len = 0; for (int i = 0; i < ns.length; i++) { ns[i].getBytes(bs, len); len = len + ns[i].len; } return fromUtf(table, bs, 0, len); }
/** Return the concatenation of this name, the given ASCII * character, and name `n'. */ public Name append(char c, Name n) { int len = getByteLength(); byte[] bs = new byte[len + 1 + n.getByteLength()]; getBytes(bs, 0); bs[len] = (byte) c; n.getBytes(bs, len+1); return table.fromUtf(bs, 0, bs.length); }
/** Return the concatenation of this name, the given ASCII * character, and name `n'. */ public Name append(char c, Name n) { int len = getByteLength(); byte[] bs = new byte[len + 1 + n.getByteLength()]; getBytes(bs, 0); bs[len] = (byte) c; n.getBytes(bs, len+1); return table.fromUtf(bs, 0, bs.length); }