本文整理了Java中io.netty.buffer.ByteBuf.readUnsignedMedium()
方法的一些代码示例,展示了ByteBuf.readUnsignedMedium()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ByteBuf.readUnsignedMedium()
方法的具体详情如下:
包路径:io.netty.buffer.ByteBuf
类名称:ByteBuf
方法名:readUnsignedMedium
[英]Gets an unsigned 24-bit medium integer at the current readerIndexand increases the readerIndex by 3 in this buffer.
[中]获取当前readerIndex处的无符号24位中整数,并在此缓冲区中将readerIndex增加3。
代码示例来源:origin: netty/netty
@Override
public int readUnsignedMedium() {
return buf.readUnsignedMedium();
}
代码示例来源:origin: redisson/redisson
@Override
public int readUnsignedMedium() {
return buf.readUnsignedMedium();
}
代码示例来源:origin: wildfly/wildfly
@Override
public int readUnsignedMedium() {
return buf.readUnsignedMedium();
}
代码示例来源:origin: micronaut-projects/micronaut-core
@Override
public int readUnsignedMedium() {
return byteBuf.readUnsignedMedium();
}
代码示例来源:origin: netty/netty
@Override
public int readUnsignedMedium() {
checkReadableBytes(3);
return buffer.readUnsignedMedium();
}
代码示例来源:origin: redisson/redisson
@Override
public int readUnsignedMedium() {
checkReadableBytes(3);
return buffer.readUnsignedMedium();
}
代码示例来源:origin: wildfly/wildfly
@Override
public int readUnsignedMedium() {
checkReadableBytes(3);
return buffer.readUnsignedMedium();
}
代码示例来源:origin: traccar/traccar
private void decodePassengers(Position position, ByteBuf buf) {
int blockLength = buf.readUnsignedShort();
int blockEnd = buf.readerIndex() + blockLength;
if (blockLength > 0) {
position.set("passengersOn", buf.readUnsignedMedium());
position.set("passengersOff", buf.readUnsignedMedium());
}
buf.readerIndex(blockEnd);
}
代码示例来源:origin: Graylog2/graylog2-server
private Optional<Object> parseUnsignedNumber(ByteBuf bb, int length) {
switch (length) {
case 1:
return Optional.of(bb.readUnsignedByte());
case 2:
return Optional.of(bb.readUnsignedShort());
case 3:
return Optional.of(bb.readUnsignedMedium());
case 4:
return Optional.of(bb.readUnsignedInt());
case 8:
return Optional.of(bb.readLong());
default:
byte[] uint64Bytes = new byte[length];
bb.readBytes(uint64Bytes);
return Optional.of(new BigInteger(uint64Bytes));
}
}
}
代码示例来源:origin: netty/netty
readData = in.readUnsignedMedium();
offset = 24;
break;
代码示例来源:origin: traccar/traccar
public float readFloat(ByteBuf buf) {
switch (buf.getUnsignedByte(buf.readerIndex()) >> 6) {
case 0:
previousFloat = buf.readInt() << 2;
break;
case 1:
previousFloat = (previousFloat & 0xffffff00) + ((buf.readUnsignedByte() & 0x3f) << 2);
break;
case 2:
previousFloat = (previousFloat & 0xffff0000) + ((buf.readUnsignedShort() & 0x3fff) << 2);
break;
case 3:
previousFloat = (previousFloat & 0xff000000) + ((buf.readUnsignedMedium() & 0x3fffff) << 2);
break;
default:
LOGGER.warn("MTA6 float decoding error", new IllegalArgumentException());
break;
}
return Float.intBitsToFloat(previousFloat);
}
代码示例来源:origin: redisson/redisson
readData = in.readUnsignedMedium();
offset = 24;
break;
代码示例来源:origin: netty/netty
final int magic = in.readUnsignedMedium();
if (magic != MAGIC_NUMBER) {
throw new DecompressionException("unexpected block identifier");
代码示例来源:origin: redisson/redisson
final int magic = in.readUnsignedMedium();
if (magic != MAGIC_NUMBER) {
throw new DecompressionException("unexpected block identifier");
代码示例来源:origin: wildfly/wildfly
readData = in.readUnsignedMedium();
offset = 24;
break;
代码示例来源:origin: traccar/traccar
break;
case 9:
buf.readUnsignedMedium();
break;
case 31:
代码示例来源:origin: traccar/traccar
private boolean decodeLbs(Position position, ByteBuf buf, boolean hasLength) {
int length = 0;
if (hasLength) {
length = buf.readUnsignedByte();
if (length == 0) {
return false;
}
}
int mcc = buf.readUnsignedShort();
int mnc = BitUtil.check(mcc, 15) ? buf.readUnsignedShort() : buf.readUnsignedByte();
position.setNetwork(new Network(CellTower.from(
BitUtil.to(mcc, 15), mnc, buf.readUnsignedShort(), buf.readUnsignedMedium())));
if (length > 9) {
buf.skipBytes(length - 9);
}
return true;
}
代码示例来源:origin: netty/netty
return;
int magicNumber = in.readUnsignedMedium();
if (magicNumber != MAGIC_NUMBER) {
throw new DecompressionException("Unexpected stream identifier contents. Mismatched bzip2 " +
代码示例来源:origin: traccar/traccar
buf.readUnsignedShort(), buf.readUnsignedShort(), buf.readUnsignedShort(), buf.readUnsignedMedium())));
代码示例来源:origin: traccar/traccar
position.set(Position.KEY_ODOMETER, buf.readUnsignedMedium());
内容来源于网络,如有侵权,请联系作者删除!