本文整理汇总了Java中org.apache.activemq.artemis.api.core.ActiveMQBuffer.readNullableString方法的典型用法代码示例。如果您正苦于以下问题:Java ActiveMQBuffer.readNullableString方法的具体用法?Java ActiveMQBuffer.readNullableString怎么用?Java ActiveMQBuffer.readNullableString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.activemq.artemis.api.core.ActiveMQBuffer
的用法示例。
在下文中一共展示了ActiveMQBuffer.readNullableString方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: streamReadByte
import org.apache.activemq.artemis.api.core.ActiveMQBuffer; //导入方法依赖的package包/类
public static byte streamReadByte(ActiveMQBuffer buff) {
int index = buff.readerIndex();
try {
byte type = buff.readByte();
switch (type) {
case DataConstants.BYTE:
return buff.readByte();
case DataConstants.STRING:
String s = buff.readNullableString();
return Byte.parseByte(s);
default:
throw new IllegalStateException("Invalid conversion");
}
} catch (NumberFormatException e) {
buff.readerIndex(index);
throw e;
}
}
示例2: 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");
}
}
示例3: 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");
}
}
示例4: 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");
}
}
示例5: streamReadString
import org.apache.activemq.artemis.api.core.ActiveMQBuffer; //导入方法依赖的package包/类
public static String streamReadString(ActiveMQBuffer buff) {
byte type = buff.readByte();
switch (type) {
case DataConstants.BOOLEAN:
return String.valueOf(buff.readBoolean());
case DataConstants.BYTE:
return String.valueOf(buff.readByte());
case DataConstants.SHORT:
return String.valueOf(buff.readShort());
case DataConstants.CHAR:
return String.valueOf((char) buff.readShort());
case DataConstants.INT:
return String.valueOf(buff.readInt());
case DataConstants.LONG:
return String.valueOf(buff.readLong());
case DataConstants.FLOAT:
return String.valueOf(Float.intBitsToFloat(buff.readInt()));
case DataConstants.DOUBLE:
return String.valueOf(Double.longBitsToDouble(buff.readLong()));
case DataConstants.STRING:
return buff.readNullableString();
default:
throw new IllegalStateException("Invalid conversion");
}
}
示例6: decodeRest
import org.apache.activemq.artemis.api.core.ActiveMQBuffer; //导入方法依赖的package包/类
@Override
public void decodeRest(final ActiveMQBuffer buffer) {
this.nodeID = buffer.readString();
this.backupGroupName = buffer.readNullableString();
this.backup = buffer.readBoolean();
this.currentEventID = buffer.readLong();
if (buffer.readBoolean()) {
connector = new TransportConfiguration();
connector.decode(buffer);
}
if (buffer.readBoolean()) {
backupConnector = new TransportConfiguration();
backupConnector.decode(buffer);
}
scaleDownGroupName = buffer.readNullableString();
}
示例7: streamReadBoolean
import org.apache.activemq.artemis.api.core.ActiveMQBuffer; //导入方法依赖的package包/类
/**
* Method to read boolean values out of the Stream protocol existent on JMS Stream Messages
* Throws IllegalStateException if the type was invalid
*
* @param buff
* @return
*/
public static boolean streamReadBoolean(ActiveMQBuffer buff) {
byte type = buff.readByte();
switch (type) {
case DataConstants.BOOLEAN:
return buff.readBoolean();
case DataConstants.STRING:
String s = buff.readNullableString();
return Boolean.valueOf(s);
default:
throw new IllegalStateException("Invalid conversion, type byte was " + type);
}
}
示例8: 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");
}
}
示例9: streamReadFloat
import org.apache.activemq.artemis.api.core.ActiveMQBuffer; //导入方法依赖的package包/类
public static float streamReadFloat(ActiveMQBuffer buff) {
byte type = buff.readByte();
switch (type) {
case DataConstants.FLOAT:
return Float.intBitsToFloat(buff.readInt());
case DataConstants.STRING:
String s = buff.readNullableString();
return Float.parseFloat(s);
default:
throw new IllegalStateException("Invalid conversion");
}
}
示例10: streamReadDouble
import org.apache.activemq.artemis.api.core.ActiveMQBuffer; //导入方法依赖的package包/类
public static double streamReadDouble(ActiveMQBuffer buff) {
byte type = buff.readByte();
switch (type) {
case DataConstants.FLOAT:
return Float.intBitsToFloat(buff.readInt());
case DataConstants.DOUBLE:
return Double.longBitsToDouble(buff.readLong());
case DataConstants.STRING:
String s = buff.readNullableString();
return Double.parseDouble(s);
default:
throw new IllegalStateException("Invalid conversion: " + type);
}
}
示例11: 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");
}
}
示例12: decodeRest
import org.apache.activemq.artemis.api.core.ActiveMQBuffer; //导入方法依赖的package包/类
@Override
public void decodeRest(final ActiveMQBuffer buffer) {
int code = buffer.readInt();
String msg = buffer.readNullableString();
exception = ActiveMQExceptionType.createException(code, msg);
}
示例13: decodeRest
import org.apache.activemq.artemis.api.core.ActiveMQBuffer; //导入方法依赖的package包/类
@Override
public void decodeRest(final ActiveMQBuffer buffer) {
name = buffer.readString();
sessionChannelID = buffer.readLong();
version = buffer.readInt();
username = buffer.readNullableString();
password = buffer.readNullableString();
minLargeMessageSize = buffer.readInt();
xa = buffer.readBoolean();
autoCommitSends = buffer.readBoolean();
autoCommitAcks = buffer.readBoolean();
windowSize = buffer.readInt();
preAcknowledge = buffer.readBoolean();
defaultAddress = buffer.readNullableString();
}
示例14: decodeRest
import org.apache.activemq.artemis.api.core.ActiveMQBuffer; //导入方法依赖的package包/类
@Override
public void decodeRest(ActiveMQBuffer buffer) {
super.decodeRest(buffer);
backupSize = buffer.readInt();
journalDirectory = buffer.readNullableString();
bindingsDirectory = buffer.readNullableString();
largeMessagesDirectory = buffer.readNullableString();
pagingDirectory = buffer.readNullableString();
nodeID = buffer.readNullableSimpleString();
}
示例15: decodeRest
import org.apache.activemq.artemis.api.core.ActiveMQBuffer; //导入方法依赖的package包/类
@Override
public void decodeRest(final ActiveMQBuffer buffer) {
error = buffer.readBoolean();
responseCode = buffer.readInt();
message = buffer.readNullableString();
}