Available Methods
- writeBytes ( )
- readableBytes ( )
- writeByte ( )
- release ( )
- writeInt ( )
- readBytes ( )
- readInt ( )
- readByte ( )
- writeShort ( )
- readerIndex ( )
- writeBoolean ( )
- isReadable ( )
- skipBytes ( )
- writerIndex ( )
- readUnsignedByte ( )
- writeLong ( )
- readBoolean ( )
- toString ( )
- readUnsignedShort ( )
- getByte ( )
- markReaderIndex ( )
- resetReaderIndex ( )
- readLong ( )
- readShort ( )
- getBytes ( )
- slice ( )
- writeIntLE ( )
- readSlice ( )
- writeFloatLE ( )
- writeCharSequence ( )
- writeZero ( )
- nioBuffer ( )
- writeShortLE ( )
- retain ( )
- readUnsignedInt ( )
- hasArray ( )
- writeLongLE ( )
- array ( )
- getUnsignedByte ( )
- readFloatLE ( )
- capacity ( )
- writeFloat ( )
- writeDouble ( )
- writeMedium ( )
- setInt ( )
- readDouble ( )
- readIntLE ( )
- forEachByte ( )
- clear ( )
- getInt ( )
- readUnsignedShortLE ( )
- copy ( )
- ensureWritable ( )
- readShortLE ( )
- readLongLE ( )
- order ( )
- arrayOffset ( )
- setByte ( )
- refCnt ( )
- internalNioBuffer ( )
- readFloat ( )
- nioBufferCount ( )
- getShort ( )
- readRetainedSlice ( )
- getLong ( )
- readUnsignedIntLE ( )
- resetWriterIndex ( )
- setBytes ( )
- writeMediumLE ( )
- indexOf ( )
- retainedSlice ( )
- retainedDuplicate ( )
- isWritable ( )
- readCharSequence ( )
- isDirect ( )
- bytesBefore ( )
- getUnsignedShort ( )
- duplicate ( )
- hasMemoryAddress ( )
- readUnsignedMediumLE ( )
- writableBytes ( )
- memoryAddress ( )
- markWriterIndex ( )
- discardReadBytes ( )
- nioBuffers ( )
- touch ( )
- setIntLE ( )
- getUnsignedMedium ( )
- getUnsignedInt ( )
- equals ( )
- setShort ( )
- writeChar ( )
- maxCapacity ( )
- setMediumLE ( )
- forEachByteDesc ( )
- getDouble ( )
- writeDoubleLE ( )
- getIntLE ( )
- readChar ( )
- getCharSequence ( )
- setLong ( )
- setShortLE ( )
- setIndex ( )
Related Classes
- java.util.Arrays
- java.util.Collections
- java.util.concurrent.TimeUnit
- java.util.UUID
- java.nio.charset.Charset
- java.net.URI
- java.nio.ByteBuffer
- org.junit.Assert
- java.util.Optional
- java.nio.charset.StandardCharsets
- java.net.InetSocketAddress
- java.util.concurrent.CountDownLatch
- com.google.common.collect.Lists
- org.mockito.Mockito
- java.util.concurrent.CompletableFuture
- com.google.common.base.Preconditions
- org.junit.jupiter.api.Test
- io.netty.channel.ChannelHandlerContext
- org.testng.annotations.Test
- io.netty.channel.Channel
- io.netty.buffer.Unpooled
- io.netty.channel.ChannelFuture
- io.netty.channel.ChannelFutureListener
- reactor.core.publisher.Mono
- reactor.core.publisher.Flux
Java Code Examples for io.netty.buffer.ByteBuf#getDouble()
The following examples show how to use
io.netty.buffer.ByteBuf#getDouble() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: NettyServerHandler.java From iot-dc3 with Apache License 2.0 | 4 votes |
@Override @SneakyThrows public void channelRead(ChannelHandlerContext context, Object msg) { ByteBuf byteBuf = (ByteBuf) msg; log.info("{}->{}", context.channel().remoteAddress(), ByteBufUtil.hexDump(byteBuf)); String deviceName = byteBuf.toString(0, 22, CharsetUtil.CHARSET_ISO_8859_1); Long deviceId = nettyServerHandler.driverContext.getDeviceIdByName(deviceName); String hexKey = ByteBufUtil.hexDump(byteBuf, 22, 1); List<PointValue> pointValues = new ArrayList<>(); Map<Long, Map<String, AttributeInfo>> pointInfoMap = nettyServerHandler.driverContext.getDevicePointInfoMap().get(deviceId); for (Long pointId : pointInfoMap.keySet()) { Point point = nettyServerHandler.driverContext.getDevicePoint(deviceId, pointId); Map<String, AttributeInfo> infoMap = pointInfoMap.get(pointId); int start = DriverUtils.value(infoMap.get("start").getType(), infoMap.get("start").getValue()); int end = DriverUtils.value(infoMap.get("end").getType(), infoMap.get("end").getValue()); if (infoMap.get("key").getValue().equals(hexKey)) { PointValue pointValue = null; switch (point.getName()) { case "海拔": float altitude = byteBuf.getFloat(start); pointValue = nettyServerHandler.driverService.convertValue(deviceId, pointId, String.valueOf(altitude)); break; case "速度": double speed = byteBuf.getDouble(start); pointValue = nettyServerHandler.driverService.convertValue(deviceId, pointId, String.valueOf(speed)); break; case "液位": long level = byteBuf.getLong(start); pointValue = nettyServerHandler.driverService.convertValue(deviceId, pointId, String.valueOf(level)); break; case "方向": int direction = byteBuf.getInt(start); pointValue = nettyServerHandler.driverService.convertValue(deviceId, pointId, String.valueOf(direction)); break; case "锁定": boolean lock = byteBuf.getBoolean(start); pointValue = nettyServerHandler.driverService.convertValue(deviceId, pointId, String.valueOf(lock)); break; case "经纬": String lalo = byteBuf.toString(start, end, CharsetUtil.CHARSET_ISO_8859_1).trim(); pointValue = nettyServerHandler.driverService.convertValue(deviceId, pointId, String.valueOf(lalo)); break; default: break; } if (null != pointValue) { pointValues.add(pointValue); } } } nettyServerHandler.driverService.pointValueSender(pointValues); }
Example 2
Source File: DataTypeCodec.java From vertx-sql-client with Apache License 2.0 | 4 votes |
private static Double binaryDecodeFLOAT8(int index, int len, ByteBuf buff) { return buff.getDouble(index); }