public long parseLong() throws IOException { return unpacker.unpackLong(); }
@Override public KeyValue next() throws IOException { if (mReader.next(mKey, mValue)) { MessageUnpacker unpacker = MessagePack.newDefaultUnpacker(mKey.getBytes()); int mapSize = unpacker.unpackMapHeader(); long offset = 0; long timestamp = -1; byte[] keyBytes = EMPTY_BYTES; for (int i = 0; i < mapSize; i++) { int key = unpacker.unpackInt(); switch (key) { case KAFKA_MESSAGE_OFFSET: offset = unpacker.unpackLong(); break; case KAFKA_MESSAGE_TIMESTAMP: timestamp = unpacker.unpackLong(); break; case KAFKA_HASH_KEY: int keySize = unpacker.unpackBinaryHeader(); keyBytes = new byte[keySize]; unpacker.readPayload(keyBytes); break; } } unpacker.close(); return new KeyValue(offset, keyBytes, Arrays.copyOfRange(mValue.getBytes(), 0, mValue.getLength()), timestamp); } else { return null; } }
case INT64: case UINT32: o = unpacker.unpackLong(); break; default:
@Override public T deserialize(JsonParser jsonParser, DeserializationContext deserializationContext) throws IOException, JsonProcessingException { var messagePackExtensionType = (MessagePackExtensionType) jsonParser.getEmbeddedObject(); if (messagePackExtensionType.getType() != typeId) { log.error("Tried to parse a bad type ({})", messagePackExtensionType.getType()); throw new JsonParseException(jsonParser, "Bad custom type"); } return constructor.apply( MessagePack.newDefaultUnpacker(messagePackExtensionType.getData()).unpackLong() ); } }
case INT64: case UINT32: o = unpacker.unpackLong(); break; default:
long l = messageUnpacker.unpackLong(); if (Integer.MIN_VALUE <= l && l <= Integer.MAX_VALUE) { type = Type.INT;
return var; default: var.setIntegerValue(unpackLong()); return var;
value.setData(unpacker.unpackShort()); } else if (format == MessageFormat.UINT32 || format == MessageFormat.INT64 || format == MessageFormat.UINT64) { value.setData(unpacker.unpackLong()); } else { value.setData(unpacker.unpackInt());
return ValueFactory.newInteger(unpackBigInteger()); default: return ValueFactory.newInteger(unpackLong());