当前位置: 首页>>代码示例>>Java>>正文


Java ActiveMQBuffer.readShort方法代码示例

本文整理汇总了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");
   }

}
 
开发者ID:apache,项目名称:activemq-artemis,代码行数:18,代码来源:StreamMessageUtil.java

示例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");
   }
}
 
开发者ID:apache,项目名称:activemq-artemis,代码行数:17,代码来源:StreamMessageUtil.java

示例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");
   }
}
 
开发者ID:apache,项目名称:activemq-artemis,代码行数:19,代码来源:StreamMessageUtil.java

示例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");
   }
}
 
开发者ID:apache,项目名称:activemq-artemis,代码行数:15,代码来源:StreamMessageUtil.java

示例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");
   }

}
 
开发者ID:apache,项目名称:activemq-artemis,代码行数:32,代码来源:StreamMessageUtil.java

示例6: bytesReadShort

import org.apache.activemq.artemis.api.core.ActiveMQBuffer; //导入方法依赖的package包/类
public static short bytesReadShort(ActiveMQBuffer message) {
   return message.readShort();
}
 
开发者ID:apache,项目名称:activemq-artemis,代码行数:4,代码来源:BytesMessageUtil.java

示例7: bytesReadChar

import org.apache.activemq.artemis.api.core.ActiveMQBuffer; //导入方法依赖的package包/类
public static char bytesReadChar(ActiveMQBuffer message) {
   return (char) message.readShort();
}
 
开发者ID:apache,项目名称:activemq-artemis,代码行数:4,代码来源:BytesMessageUtil.java

示例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);
}
 
开发者ID:apache,项目名称:activemq-artemis,代码行数:7,代码来源:QueueStatusEncoding.java


注:本文中的org.apache.activemq.artemis.api.core.ActiveMQBuffer.readShort方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。