public int encode() {	
		byte[] keybytes = null;
		if (key == null) {
			return TairConstant.SERIALIZEERROR;
		}
		try {
			keybytes = transcoder.encode(key);
		} catch (Throwable e) {
			return TairConstant.SERIALIZEERROR;
		}
		if (keybytes == null) {
			return TairConstant.SERIALIZEERROR;
		}
		
		if(keybytes.length >= TairConstant.TAIR_KEY_MAX_LENTH) {
			return TairConstant.KEYTOLARGE;
		}
		
		writePacketBegin(keybytes.length + HEADER_LEN);
		byteBuffer.put((byte) 0); // 1 byte push server flag
		byteBuffer.putShort(namespace);  // 2 byte push ns 
		byteBuffer.putShort(version);    // 2
		byteBuffer.putInt(expire);       // 4
		byteBuffer.putInt(count);			// 4 byte count
		byteBuffer.putInt(keybytes.length);// 4 byte length
		byteBuffer.put(keybytes); // keybytes.length
		writePacketEnd();
		return 0;
	}