本文整理汇总了Java中org.apache.activemq.artemis.api.core.ActiveMQBuffer.readInt方法的典型用法代码示例。如果您正苦于以下问题:Java ActiveMQBuffer.readInt方法的具体用法?Java ActiveMQBuffer.readInt怎么用?Java ActiveMQBuffer.readInt使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.activemq.artemis.api.core.ActiveMQBuffer
的用法示例。
在下文中一共展示了ActiveMQBuffer.readInt方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: 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");
}
}
示例2: decodeRest
import org.apache.activemq.artemis.api.core.ActiveMQBuffer; //导入方法依赖的package包/类
@Override
public void decodeRest(final ActiveMQBuffer buffer) {
fileId = buffer.readLong();
switch (FileType.getFileType(buffer.readByte())) {
case JOURNAL: {
journalType = AbstractJournalStorageManager.JournalContent.getType(buffer.readByte());
fileType = FileType.JOURNAL;
break;
}
case PAGE: {
pageStoreName = buffer.readSimpleString();
fileType = FileType.PAGE;
break;
}
case LARGE_MESSAGE: {
fileType = FileType.LARGE_MESSAGE;
break;
}
}
int size = buffer.readInt();
if (size > 0) {
byteArray = new byte[size];
buffer.readBytes(byteArray);
}
}
示例3: decodeRest
import org.apache.activemq.artemis.api.core.ActiveMQBuffer; //导入方法依赖的package包/类
@Override
public void decodeRest(final ActiveMQBuffer buffer) {
int size = buffer.readInt();
body = new byte[size];
buffer.readBytes(body);
continues = buffer.readBoolean();
}
示例4: 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();
}
示例5: decodeRest
import org.apache.activemq.artemis.api.core.ActiveMQBuffer; //导入方法依赖的package包/类
@Override
public void decodeRest(final ActiveMQBuffer buffer) {
super.decodeRest(buffer);
autoCreated = buffer.readBoolean();
routingType = RoutingType.getType(buffer.readByte());
maxConsumers = buffer.readInt();
purgeOnNoConsumers = buffer.readBoolean();
}
示例6: readNullableInteger
import org.apache.activemq.artemis.api.core.ActiveMQBuffer; //导入方法依赖的package包/类
public static Integer readNullableInteger(ActiveMQBuffer buffer) {
boolean isNotNull = buffer.readBoolean();
if (isNotNull) {
return buffer.readInt();
} else {
return null;
}
}
示例7: 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();
}
示例8: decodeRest
import org.apache.activemq.artemis.api.core.ActiveMQBuffer; //导入方法依赖的package包/类
@Override
public void decodeRest(final ActiveMQBuffer buffer) {
messageId = buffer.readLong();
int size = buffer.readInt();
body = new byte[size];
buffer.readBytes(body);
}
示例9: decodeRest
import org.apache.activemq.artemis.api.core.ActiveMQBuffer; //导入方法依赖的package包/类
@Override
public void decodeRest(final ActiveMQBuffer buffer) {
exists = buffer.readBoolean();
int numQueues = buffer.readInt();
queueNames = new ArrayList<>(numQueues);
for (int i = 0; i < numQueues; i++) {
queueNames.add(buffer.readSimpleString());
}
}
示例10: read
import org.apache.activemq.artemis.api.core.ActiveMQBuffer; //导入方法依赖的package包/类
private int read(StorageManager storage, ActiveMQBuffer fileBuffer, List<PagedMessage> messages) {
int readMessages = 0;
while (fileBuffer.readable()) {
final int position = fileBuffer.readerIndex();
byte byteRead = fileBuffer.readByte();
if (byteRead == Page.START_BYTE) {
if (fileBuffer.readerIndex() + DataConstants.SIZE_INT < fileBuffer.capacity()) {
int messageSize = fileBuffer.readInt();
int oldPos = fileBuffer.readerIndex();
if (fileBuffer.readerIndex() + messageSize < fileBuffer.capacity() && fileBuffer.getByte(oldPos + messageSize) == Page.END_BYTE) {
PagedMessage msg = new PagedMessageImpl(storageManager);
msg.decode(fileBuffer);
byte b = fileBuffer.readByte();
if (b != Page.END_BYTE) {
// Sanity Check: This would only happen if there is a bug on decode or any internal code, as
// this
// constraint was already checked
throw new IllegalStateException("Internal error, it wasn't possible to locate END_BYTE " + b);
}
msg.initMessage(storage);
if (logger.isTraceEnabled()) {
logger.trace("Reading message " + msg + " on pageId=" + this.pageId + " for address=" + storeName);
}
readMessages++;
messages.add(msg);
} else {
markFileAsSuspect(file.getFileName(), position, messages.size());
break;
}
}
} else {
markFileAsSuspect(file.getFileName(), position, messages.size());
break;
}
}
return readMessages;
}
示例11: decodeRest
import org.apache.activemq.artemis.api.core.ActiveMQBuffer; //导入方法依赖的package包/类
@Override
public void decodeRest(final ActiveMQBuffer buffer) {
synchronizationIsFinished = buffer.readBoolean();
allowsAutoFailBack = buffer.readBoolean();
nodeID = buffer.readString();
if (synchronizationIsFinished) {
return;
}
dataType = SyncDataType.getDataType(buffer.readByte());
int length = buffer.readInt();
ids = new long[length];
for (int i = 0; i < length; i++) {
ids[i] = buffer.readLong();
}
}
示例12: decodeRest
import org.apache.activemq.artemis.api.core.ActiveMQBuffer; //导入方法依赖的package包/类
@Override
public void decodeRest(final ActiveMQBuffer buffer) {
name = buffer.readString();
lastConfirmedCommandID = buffer.readInt();
}
示例13: readControlFile
import org.apache.activemq.artemis.api.core.ActiveMQBuffer; //导入方法依赖的package包/类
public static SequentialFile readControlFile(final SequentialFileFactory fileFactory,
final List<String> dataFiles,
final List<String> newFiles,
final List<Pair<String, String>> renameFile) throws Exception {
SequentialFile controlFile = fileFactory.createSequentialFile(AbstractJournalUpdateTask.FILE_COMPACT_CONTROL);
if (controlFile.exists()) {
JournalFile file = new JournalFileImpl(controlFile, 0, JournalImpl.FORMAT_VERSION);
final ArrayList<RecordInfo> records = new ArrayList<>();
JournalImpl.readJournalFile(fileFactory, file, new JournalReaderCallbackAbstract() {
@Override
public void onReadAddRecord(final RecordInfo info) throws Exception {
records.add(info);
}
});
if (records.size() == 0) {
// the record is damaged
controlFile.delete();
return null;
} else {
ActiveMQBuffer input = ActiveMQBuffers.wrappedBuffer(records.get(0).data);
int numberDataFiles = input.readInt();
for (int i = 0; i < numberDataFiles; i++) {
dataFiles.add(input.readUTF());
}
int numberNewFiles = input.readInt();
for (int i = 0; i < numberNewFiles; i++) {
newFiles.add(input.readUTF());
}
int numberRenames = input.readInt();
for (int i = 0; i < numberRenames; i++) {
String from = input.readUTF();
String to = input.readUTF();
renameFile.add(new Pair<>(from, to));
}
}
return controlFile;
} else {
return null;
}
}
示例14: decodeRest
import org.apache.activemq.artemis.api.core.ActiveMQBuffer; //导入方法依赖的package包/类
@Override
public void decodeRest(final ActiveMQBuffer buffer) {
commandID = buffer.readInt();
}
示例15: decodeRest
import org.apache.activemq.artemis.api.core.ActiveMQBuffer; //导入方法依赖的package包/类
@Override
public void decodeRest(final ActiveMQBuffer buffer) {
timeoutSeconds = buffer.readInt();
}