@Override public int readIntLE() { return buf.readIntLE(); }
/** * Read 4 byte fixed length integer from byte buffers. * * @see <a href="https://dev.mysql.com/doc/internals/en/integer.html#packet-Protocol::FixedLengthInteger">FixedLengthInteger</a> * * @return 4 byte fixed length integer */ public int readInt4() { return byteBuf.readIntLE(); }
/** * Read 4 byte fixed length integer from byte buffers. * * @see <a href="https://dev.mysql.com/doc/internals/en/integer.html#packet-Protocol::FixedLengthInteger">FixedLengthInteger</a> * * @return 4 byte fixed length integer */ public int readInt4() { return byteBuf.readIntLE(); }
@Override public int readIntLE() { return buf.readIntLE(); }
/** * Gets a 32-bit floating point number at the current {@code readerIndex} * in Little Endian Byte Order and increases the {@code readerIndex} * by {@code 4} in this buffer. * * @throws IndexOutOfBoundsException * if {@code this.readableBytes} is less than {@code 4} */ public float readFloatLE() { return Float.intBitsToFloat(readIntLE()); }
/** Read a 32-bit little-endian integer from the stream. */ public int readRawLittleEndian32() throws IOException { return buf.readIntLE(); }
@Override public int readIntLE() { return buf.readIntLE(); }
/** * Gets a 32-bit floating point number at the current {@code readerIndex} * in Little Endian Byte Order and increases the {@code readerIndex} * by {@code 4} in this buffer. * * @throws IndexOutOfBoundsException * if {@code this.readableBytes} is less than {@code 4} */ public float readFloatLE() { return Float.intBitsToFloat(readIntLE()); }
@Override public int readIntLE() { return byteBuf.readIntLE(); }
/** * Gets a 32-bit floating point number at the current {@code readerIndex} * in Little Endian Byte Order and increases the {@code readerIndex} * by {@code 4} in this buffer. * * @throws IndexOutOfBoundsException * if {@code this.readableBytes} is less than {@code 4} */ public float readFloatLE() { return Float.intBitsToFloat(readIntLE()); }
@Override public int readIntLE() { checkReadableBytes(4); return buffer.readIntLE(); }
@Override public int readIntLE() { checkReadableBytes(4); return buffer.readIntLE(); }
@Override public int readIntLE() { checkReadableBytes(4); return buffer.readIntLE(); }
int offset = in.readIntLE();
return NOT_ENOUGH_INPUT; length = in.readIntLE(); break; default:
private Object decode(ByteBuf buf, State state, Decoder<?> decoder) throws IOException { int keyLen; if (isWindows) { keyLen = buf.readIntLE(); } else { keyLen = (int) buf.readLongLE(); } ByteBuf keyBuf = buf.readSlice(keyLen); Object key = decoder.decode(keyBuf, state); return key; }
private Object decode(ByteBuf buf, State state, Decoder<?> decoder) throws IOException { int keyLen; if (isWindows) { keyLen = buf.readIntLE(); } else { keyLen = (int) buf.readLongLE(); } ByteBuf keyBuf = buf.readSlice(keyLen); Object key = decoder.decode(keyBuf, state); return key; }
@Override public Object decode(ByteBuf buf, State state) throws IOException { List<Object> result = new ArrayList<Object>(); int keyLen; if (PlatformDependent.isWindows()) { keyLen = buf.readIntLE(); } else { keyLen = (int) buf.readLongLE(); } ByteBuf keyBuf = buf.readSlice(keyLen); Object key = codec.getMapKeyDecoder().decode(keyBuf, state); result.add(key); int valueLen; if (PlatformDependent.isWindows()) { valueLen = buf.readIntLE(); } else { valueLen = (int) buf.readLongLE(); } ByteBuf valueBuf = buf.readSlice(valueLen); Object value = codec.getMapValueDecoder().decode(valueBuf, state); result.add(value); if (sync) { double syncId = buf.order(ByteOrder.LITTLE_ENDIAN).readDouble(); result.add(syncId); } return result; } };
@Override public Object decode(ByteBuf buf, State state) throws IOException { List<Object> result = new ArrayList<Object>(); int keyLen; if (PlatformDependent.isWindows()) { keyLen = buf.readIntLE(); } else { keyLen = (int) buf.readLongLE(); } ByteBuf keyBuf = buf.readSlice(keyLen); Object key = codec.getMapKeyDecoder().decode(keyBuf, state); result.add(key); int valueLen; if (PlatformDependent.isWindows()) { valueLen = buf.readIntLE(); } else { valueLen = (int) buf.readLongLE(); } ByteBuf valueBuf = buf.readSlice(valueLen); Object value = codec.getMapValueDecoder().decode(valueBuf, state); result.add(value); if (sync) { double syncId = buf.order(ByteOrder.LITTLE_ENDIAN).readDouble(); result.add(syncId); } return result; } };
private Position parsePositionReport2( DeviceSession deviceSession, ByteBuf buf, int sequenceNumber, long timestamp) { Position position = new Position(getProtocolName()); position.set(Position.KEY_INDEX, sequenceNumber); position.setDeviceId(deviceSession.getDeviceId()); position.setTime(convertTimestamp(timestamp)); position.setLatitude(buf.readIntLE() * 0.0000001); position.setLongitude(buf.readIntLE() * 0.0000001); buf.readUnsignedByte(); // report trigger position.setSpeed(UnitsConverter.knotsFromKph(buf.readUnsignedByte())); short flags = buf.readUnsignedByte(); position.setValid((flags & 0x80) == 0x80 && (flags & 0x40) == 0x40); position.set(Position.KEY_SATELLITES, buf.readUnsignedByte()); position.set(Position.KEY_ODOMETER, buf.readUnsignedIntLE()); return position; }