final synchronized public String getString() throws Exception
    {
        if (type != Type.STRUCT)
            throw new Exception("Type " + type + " does not contain string");
        final short code = data.getShort(0);
        final Type el_type = Type.forCode(code);
        if (el_type != Type.STRUCT_STRING)
            throw new Exception("No string, structure element is of type " + type);
        final int len = data.getInt(2);
        final byte[] chars = new byte[len];
        for (int i=0; i<len; ++i)
            chars[i] = data.get(6 + i);
        return new String(chars);
    }