在xtend中循环,从Java转换

时间:2013-09-12 00:36:18

标签: java xtend

如何在Xtend中完成此循环?

for (char character = '\0'; character != PacketConstants.STRING_TERMINATOR; character = (char) buffer.get())

我已经阅读了文档并尝试了几种不同的东西,我无法让它工作。

1 个答案:

答案 0 :(得分:1)

Xtend中没有for(;;)循环。您应该使用while循环代替:

var char character = 0 as char
while (character != PacketConstants.STRING_TERMINATOR) {
    character = buffer.get() as char
}