本文整理汇总了Java中com.intellij.rt.execution.junit.segments.PacketWriter.appendLong方法的典型用法代码示例。如果您正苦于以下问题:Java PacketWriter.appendLong方法的具体用法?Java PacketWriter.appendLong怎么用?Java PacketWriter.appendLong使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.intellij.rt.execution.junit.segments.PacketWriter
的用法示例。
在下文中一共展示了PacketWriter.appendLong方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createPacket
import com.intellij.rt.execution.junit.segments.PacketWriter; //导入方法依赖的package包/类
public synchronized PacketWriter createPacket(char id) {
PacketWriter writer = new PacketWriter();
myLastMessageId++;
writer.appendLong(myLastMessageId);
writer.appendChar(id);
return writer;
}
示例2: createPacket
import com.intellij.rt.execution.junit.segments.PacketWriter; //导入方法依赖的package包/类
private PacketWriter createPacket(char id, int priority) {
PacketWriter packet = PacketFactory.ourInstance.createPacket(id);
packet.appendLong(priority);
return packet;
}
示例3: handleInput
import com.intellij.rt.execution.junit.segments.PacketWriter; //导入方法依赖的package包/类
public void handleInput(InputRequest request) throws BuildException {
final String prompt = request.getPrompt();
if (prompt == null) {
throw new BuildException("Prompt is null");
}
final SegmentedOutputStream err = IdeaAntLogger2.ourErr;
if (err == null) {
throw new BuildException("Selected InputHandler should be used by Intellij IDEA");
}
final PacketWriter packet = PacketFactory.ourInstance.createPacket(IdeaAntLogger2.INPUT_REQUEST);
packet.appendLimitedString(prompt);
packet.appendLimitedString(request.getDefaultValue());
if (request instanceof MultipleChoiceInputRequest) {
Vector choices = ((MultipleChoiceInputRequest)request).getChoices();
if (choices != null && choices.size() > 0) {
int count = choices.size();
packet.appendLong(count);
for (int i = 0; i < count; i++) {
packet.appendLimitedString((String)choices.elementAt(i));
}
}
else {
packet.appendLong(0);
}
}
else {
packet.appendLong(0);
}
packet.sendThrough(err);
try {
final byte[] replayLength = readBytes(4);
final int length = ((int)replayLength[0] << 24) | ((int)replayLength[1] << 16) | ((int)replayLength[2] << 8) | replayLength[3];
final byte[] replay = readBytes(length);
final String input = new String(replay);
request.setInput(input);
if (!request.isInputValid()) {
throw new BuildException("Invalid input: " + input);
}
}
catch (IOException e) {
throw new BuildException(e);
}
}