本文整理汇总了Java中org.apache.activemq.artemis.api.core.ActiveMQBuffer.readShort方法的典型用法代码示例。如果您正苦于以下问题:Java ActiveMQBuffer.readShort方法的具体用法?Java ActiveMQBuffer.readShort怎么用?Java ActiveMQBuffer.readShort使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.activemq.artemis.api.core.ActiveMQBuffer
的用法示例。
在下文中一共展示了ActiveMQBuffer.readShort方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: streamReadChar
import org.apache.activemq.artemis.api.core.ActiveMQBuffer; //导入方法依赖的package包/类
public static char streamReadChar(ActiveMQBuffer buff) {
byte type = buff.readByte();
switch (type) {
case DataConstants.CHAR:
return (char) buff.readShort();
case DataConstants.STRING:
String str = buff.readNullableString();
if (str == null) {
throw new NullPointerException("Invalid conversion");
} else {
throw new IllegalStateException("Invalid conversion");
}
default:
throw new IllegalStateException("Invalid conversion");
}
}
示例2: streamReadInteger
import org.apache.activemq.artemis.api.core.ActiveMQBuffer; //导入方法依赖的package包/类
public static int streamReadInteger(ActiveMQBuffer buff) {
byte type = buff.readByte();
switch (type) {
case DataConstants.BYTE:
return buff.readByte();
case DataConstants.SHORT:
return buff.readShort();
case DataConstants.INT:
return buff.readInt();
case DataConstants.STRING:
String s = buff.readNullableString();
return Integer.parseInt(s);
default:
throw new IllegalStateException("Invalid conversion");
}
}
示例3: streamReadLong
import org.apache.activemq.artemis.api.core.ActiveMQBuffer; //导入方法依赖的package包/类
public static long streamReadLong(ActiveMQBuffer buff) {
byte type = buff.readByte();
switch (type) {
case DataConstants.BYTE:
return buff.readByte();
case DataConstants.SHORT:
return buff.readShort();
case DataConstants.INT:
return buff.readInt();
case DataConstants.LONG:
return buff.readLong();
case DataConstants.STRING:
String s = buff.readNullableString();
return Long.parseLong(s);
default:
throw new IllegalStateException("Invalid conversion");
}
}
示例4: streamReadShort
import org.apache.activemq.artemis.api.core.ActiveMQBuffer; //导入方法依赖的package包/类
public static short streamReadShort(ActiveMQBuffer buff) {
byte type = buff.readByte();
switch (type) {
case DataConstants.BYTE:
return buff.readByte();
case DataConstants.SHORT:
return buff.readShort();
case DataConstants.STRING:
String s = buff.readNullableString();
return Short.parseShort(s);
default:
throw new IllegalStateException("Invalid conversion");
}
}
示例5: streamReadObject
import org.apache.activemq.artemis.api.core.ActiveMQBuffer; //导入方法依赖的package包/类
public static Object streamReadObject(ActiveMQBuffer buff) {
byte type = buff.readByte();
switch (type) {
case DataConstants.BOOLEAN:
return buff.readBoolean();
case DataConstants.BYTE:
return buff.readByte();
case DataConstants.SHORT:
return buff.readShort();
case DataConstants.CHAR:
return (char) buff.readShort();
case DataConstants.INT:
return buff.readInt();
case DataConstants.LONG:
return buff.readLong();
case DataConstants.FLOAT:
return Float.intBitsToFloat(buff.readInt());
case DataConstants.DOUBLE:
return Double.longBitsToDouble(buff.readLong());
case DataConstants.STRING:
return buff.readNullableString();
case DataConstants.BYTES:
int bufferLen = buff.readInt();
byte[] bytes = new byte[bufferLen];
buff.readBytes(bytes);
return bytes;
default:
throw new IllegalStateException("Invalid conversion");
}
}
示例6: bytesReadShort
import org.apache.activemq.artemis.api.core.ActiveMQBuffer; //导入方法依赖的package包/类
public static short bytesReadShort(ActiveMQBuffer message) {
return message.readShort();
}
示例7: bytesReadChar
import org.apache.activemq.artemis.api.core.ActiveMQBuffer; //导入方法依赖的package包/类
public static char bytesReadChar(ActiveMQBuffer message) {
return (char) message.readShort();
}
示例8: decode
import org.apache.activemq.artemis.api.core.ActiveMQBuffer; //导入方法依赖的package包/类
@Override
public void decode(final ActiveMQBuffer buffer) {
super.decode(buffer);
short shortStatus = buffer.readShort();
this.status = QueueStatus.fromID(shortStatus);
}