Source:
protected void encode(final ChannelHandlerContext context, final SendableApnsPushNotification<T> sendablePushNotification, final ByteBuf out) throws Exception { out.writeByte(BINARY_PUSH_NOTIFICATION_COMMAND); out.writeInt(this.getFrameLength(sendablePushNotification)); out.writeByte(ApnsFrameItem.SEQUENCE_NUMBER.getCode()); out.writeShort(SEQUENCE_NUMBER_SIZE); out.writeInt(sendablePushNotification.getSequenceNumber()); out.writeByte(ApnsFrameItem.DEVICE_TOKEN.getCode()); out.writeShort(sendablePushNotification.getPushNotification().getToken().length); out.writeBytes(sendablePushNotification.getPushNotification().getToken()); final byte[] payloadBytes = sendablePushNotification.getPushNotification().getPayload().getBytes(utf8); out.writeByte(ApnsFrameItem.PAYLOAD.getCode()); out.writeShort(payloadBytes.length); out.writeBytes(payloadBytes); out.writeByte(ApnsFrameItem.EXPIRATION.getCode()); out.writeShort(EXPIRATION_SIZE); final int expiration; if (sendablePushNotification.getPushNotification().getDeliveryInvalidationTime() != null) { expiration = this.getTimestampInSeconds( sendablePushNotification.getPushNotification().getDeliveryInvalidationTime()); } else { expiration = EXPIRE_IMMEDIATELY; } out.writeInt(expiration); final DeliveryPriority priority = sendablePushNotification.getPushNotification().getPriority() != null ? sendablePushNotification.getPushNotification().getPriority() : DeliveryPriority.IMMEDIATE; out.writeByte(ApnsFrameItem.PRIORITY.getCode()); out.writeShort(PRIORITY_SIZE); out.writeByte(priority.getCode()); }

Target:
protected void encode(final ChannelHandlerContext context, final SendableApnsPushNotification<T> sendablePushNotification, final ByteBuf out) throws Exception { out.writeByte(BINARY_PUSH_NOTIFICATION_COMMAND); out.writeInt(this.getFrameLength(sendablePushNotification)); out.writeByte(ApnsFrameItem.SEQUENCE_NUMBER.getCode()); out.writeShort(SEQUENCE_NUMBER_SIZE); out.writeInt(sendablePushNotification.getSequenceNumber()); out.writeByte(ApnsFrameItem.DEVICE_TOKEN.getCode()); out.writeShort(sendablePushNotification.getPushNotification().getToken().length); out.writeBytes(sendablePushNotification.getPushNotification().getToken()); final byte[] payloadBytes = sendablePushNotification.getPushNotification().getPayload().getBytes(utf8); out.writeByte(ApnsFrameItem.PAYLOAD.getCode()); out.writeShort(payloadBytes.length); out.writeBytes(payloadBytes); out.writeByte(ApnsFrameItem.DELIVERY_INVALIDATION_TIME.getCode()); out.writeShort(DELIVERY_INVALIDATION_TIME_SIZE); final int deliveryInvalidationTime; if (sendablePushNotification.getPushNotification().getDeliveryInvalidationTime() != null) { deliveryInvalidationTime = this.getTimestampInSeconds( sendablePushNotification.getPushNotification().getDeliveryInvalidationTime()); } else { deliveryInvalidationTime = INVALIDATE_IMMEDIATELY; } out.writeInt(deliveryInvalidationTime); final DeliveryPriority priority = sendablePushNotification.getPushNotification().getPriority() != null ? sendablePushNotification.getPushNotification().getPriority() : DeliveryPriority.IMMEDIATE; out.writeByte(ApnsFrameItem.PRIORITY.getCode()); out.writeShort(PRIORITY_SIZE); out.writeByte(priority.getCode()); }