public static BinaryObj Checkout(BinaryObj.PresetType type) { if (type == BinaryObj.PresetType.RequestToMatching) { return(PoolForReq.Pool.Checkout()); } else if (type == BinaryObj.PresetType.ProcessOrderResult) { return(PoolForResp.Pool.Checkout()); } else if (type == BinaryObj.PresetType.Transaction) { return(PoolForTx.Pool.Checkout()); } return(null); }
public BinaryObjPool(int byteArrayLength, BinaryObj.PresetType t = BinaryObj.PresetType.Unknown) { Pool = new objPool <BinaryObj>(() => new BinaryObj(byteArrayLength, t)); }